From: eregontp@... Date: 2021-05-14T18:22:10+00:00 Subject: [ruby-core:103853] [Ruby master Feature#17849] Fix Timeout.timeout so that it can be used in threaded Web servers Issue #17849 has been updated by Eregon (Benoit Daloze). This is also a bit related to the proposed `Timeout.wake` in #17363, but that would only interrupt blocking methods and it's unclear if that includes Regexp matching (probably not since it's CPU work, not waiting on anything external), and it would definitely not include code that does not block but runs for too long (e.g. a very long loop). Long story short, this proposal would be general, `Timeout.wake` would not and would only address blocking methods. ---------------------------------------- Feature #17849: Fix Timeout.timeout so that it can be used in threaded Web servers https://bugs.ruby-lang.org/issues/17849#change-91974 * 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: