[#101179] Spectre Mitigations — Amel <amel.smajic@...>
Hi there!
5 messages
2020/12/01
[#101180] Re: Spectre Mitigations
— Chris Seaton <chris@...>
2020/12/01
I wouldn’t recommend using Ruby to run in-process untrusted code in the first place. Are people doing that?
[#101694] Ruby 3.0.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 3.0.0. From 2015 we
4 messages
2020/12/25
[ruby-core:101378] [Ruby master Feature#17363] Timeouts
From:
marcandre-ruby-core@...
Date:
2020-12-10 10:37:49 UTC
List:
ruby-core #101378
Issue #17363 has been updated by marcandre (Marc-Andre Lafortune).
ko1 (Koichi Sasada) wrote in #note-4:
> I also positive to introduce `timeout` but not sure what happens on timeout.
>
> * raise an exception -> which exception?
How about subclassing `Timeout::Error` to create `Queue::Timeout` and `Ractor::Timeout`?
> * return `nil` -> can't recognize returned value
Agreed, it is not a good solution.
> I think `timeout: nil` is same as no `timeout:` given. Is it same as other methods?
Agree.
I think `queue.pop(timeout: 0)` should be same as `queue.pop(true)` but raise `Queue:Timeout`.
Same idea with Ractor, `timeout: 0` is non-blocking version of `Ractor.receive/receive_if/select`.
----------------------------------------
Feature #17363: Timeouts
https://bugs.ruby-lang.org/issues/17363#change-89137
* Author: marcandre (Marc-Andre Lafortune)
* Status: Open
* Priority: Normal
----------------------------------------
Builtin methods like `Queue.pop` and `Ractor.receive` have no timeout parameter.
We should either:
- provide such a parameter
- and/or provide a `Timeout::wake` that raises an timeout error only if the block is currently sleeping.
Details:
```ruby
q = Queue.new
# ...
elem = Timeout::timeout(42) { q.pop } # => It is possible that an element is retreived from the queue but never stored in `elem`
elem = Timeout::wake(42) { q.pop } # => Guaranteed that either element is retrieved from the queue or an exception is raised, never both
Timeout::wake(42) { loop {} } # => infinite loop
# and/or
elem = q.pop(timeout: 42)
```
Currently, the only reliable way to have a Queue that accepts a timeout is to re-implement it from scratch. This post describe how involved that can be: https://spin.atomicobject.com/2017/06/28/queue-pop-with-timeout-fixed/
--
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>