[#106341] [Ruby master Bug#18369] users.detect(:name, "Dorian") as shorthand for users.detect { |user| user.name == "Dorian" } — dorianmariefr <noreply@...>
Issue #18369 has been reported by dorianmariefr (Dorian Mari辿).
14 messages
2021/11/30
[#106351] [Ruby master Bug#18371] Release branches (release information in general) — "tenderlovemaking (Aaron Patterson)" <noreply@...>
Issue #18371 has been reported by tenderlovemaking (Aaron Patterson).
7 messages
2021/11/30
[ruby-core:105964] [Ruby master Feature#17849] Fix Timeout.timeout so that it can be used in threaded Web servers
From:
"mame (Yusuke Endoh)" <noreply@...>
Date:
2021-11-08 08:58:39 UTC
List:
ruby-core #105964
Issue #17849 has been updated by mame (Yusuke Endoh).
@headius
headius (Charles Nutter) wrote in #note-18:
> This is incorrect code.
I believe that my code is correct under the current implementation of MRI. You may think that the method invocation itself `Thread.handle_interrupt(...) do ... end` could be interrupted, but it is not true. There is no point of interruption checks during this method invocation, under the current implementation of MRI. This is very subtle implementation detail of MRI, but it is as I have already stated in #note-14.
Here is a test:
```
def foo
begin
sleep
ensure
Thread.handle_interrupt(Object => :never) do
$finalized = true
end
end
end
Thread.report_on_exception = false
1000.times do
$finalized = false
th = Thread.new { foo }
sleep 0.1
3000.times { th.raise }
begin
th.join
rescue
end
raise "test failed" unless $finalized
end
```
----------------------------------------
Feature #17849: Fix Timeout.timeout so that it can be used in threaded Web servers
https://bugs.ruby-lang.org/issues/17849#change-94511
* Author: duerst (Martin D端rst)
* Status: Open
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
----------------------------------------
Making this a separate issue from #17837
Eregon (Benoit Daloze) wrote in https://bugs.ruby-lang.org/issues/17837#note-10 (which is about timeouts for regular expressions):
> I think fixing Timeout.timeout might be possible.
> The main/major issue is it can trigger within `ensure`, right? Is there anything else?
> We could automatically mask `Thread#raise` within `ensure` so it only happens after the `ensure` body completes.
> And we could still have a larger "hard timeout" if an `ensure` takes way too long (shouldn't happen, but one cannot be sure).
> I recall discussing this with @schneems some time ago on Twitter.
--
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>