[#92891] Question: ruby 2.7.0-preview1 also upgrades bundler to 2.1.0.pre.1? — Al Snow <jasnow@...>
Tried the new 2.7.0-preview1 upgrade to Ruby and see that bundler is also upgraded (to 2.1.0.pre.1).
5 messages
2019/05/30
[#92892] Re: Question: ruby 2.7.0-preview1 also upgrades bundler to 2.1.0.pre.1?
— SHIBATA Hiroshi <hsbt@...>
2019/05/30
Bundler 2.1.0.pree.1 is the expected version.
[ruby-core:92912] [Ruby trunk Bug#15886] return in rescue block breaks Timeout.timeout
From:
merch-redmine@...
Date:
2019-05-31 14:24:48 UTC
List:
ruby-core #92912
Issue #15886 has been updated by jeremyevans0 (Jeremy Evans).
moio (Silvio Moioli) wrote:
> Well, as a Timeout.timeout user I would like to be able to wrap any code in a block and have a guarantee it will actually terminate after the specified number of seconds - no matter how the wrapped code looks like and especially if it is from a third party.
I don't think this is something Ruby can guarantee. If you really want that level of control, you need to run the code in a separate process, and kill it with operating system signals after the timeout (including SIGKILL if the process doesn't respond to other signals). Using a separate process means that you need to use some form of IPC to transfer data between the processes.
----------------------------------------
Bug #15886: return in rescue block breaks Timeout.timeout
https://bugs.ruby-lang.org/issues/15886#change-78285
* Author: moio (Silvio Moioli)
* Status: Rejected
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux-gnu]
* Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Passing `Timeout.timeout` a block with a rescue clause that contains a return statement prevents `Timeout::Error` to be raised as expected.
Reproducer:
``` ruby
require 'timeout'
begin
Timeout.timeout(1) do
begin
sleep 10
ensure
puts "ensure block executed"
## commenting line below restores expected behaviour
return true
end
end
rescue Timeout::Error => e
puts "EXPECTED BEHAVIOUR: timeout error rescued"
end
```
Expected output:
```
ensure block executed
EXPECTED BEHAVIOR: timeout error rescued
```
Actual output:
```
ensure block executed
```
Looking in Redmine the following two issues appear related (but I lack the insight to tell for sure):
- https://bugs.ruby-lang.org/issues/14859
- https://bugs.ruby-lang.org/issues/7503
I apologize in advance if this issue is a duplicate.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>