| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/timeout/commit/ab79dfff47
|
|
* Fixes https://github.com/ruby/timeout/issues/17
https://github.com/ruby/timeout/commit/1a499a8f96
|
|
https://github.com/ruby/timeout/commit/cb2ba88fed
|
|
https://github.com/ruby/timeout/commit/7cfa5a6778
|
|
* Add tests related to Thread.handle_interrupt
* Fixes https://github.com/ruby/timeout/issues/41
https://github.com/ruby/timeout/commit/a52720e82a
|
|
https://github.com/ruby/timeout/commit/837d5aac73
|
|
https://github.com/ruby/timeout/commit/281b2507e7
|
|
* Fix indentation to stay a multiple of 2 spaces.
https://github.com/ruby/timeout/commit/a1d784cb66
|
|
https://github.com/ruby/timeout/commit/82fb6f6925
|
|
https://github.com/ruby/timeout/commit/daab9a2193
|
|
1. Introduce State to store all status.
2. Store State instance to the Ractor local storage if possible
3. Make `GET_TIME` (Method object) shareable if possible
3 is supporeted Ruby 4.0 and later, so the Rator support is works
only on Ruby 4.0 and later.
https://github.com/ruby/timeout/commit/54ff671c6c
|
|
https://github.com/ruby/timeout/commit/cd51eac3ca
|
|
https://github.com/ruby/timeout/commit/f42b47d383
|
|
a signal handler
* Fixes the issue described in
https://github.com/ruby/timeout/issues/17#issuecomment-1461498517
for TruffleRuby and JRuby.
* CRuby is currently unable to use Timeout in a signal handler due to
https://bugs.ruby-lang.org/issues/19473.
https://github.com/ruby/timeout/commit/7a48e1c079
|
|
https://github.com/ruby/timeout/commit/607d8c6fbe
|
|
https://github.com/ruby/timeout/commit/7d2af46a00
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
|
|
https://github.com/ruby/timeout/commit/4be6423de4
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
|
|
https://github.com/ruby/timeout/commit/f992632cf3
|
|
added tests
https://github.com/ruby/timeout/commit/ffc8d7c003
|
|
type-errror and added tests
https://github.com/ruby/timeout/commit/8342544979
|
|
https://github.com/ruby/timeout/commit/8e57887eee
|
|
https://github.com/ruby/timeout/commit/2f52522994
|
|
This is a followup to #49.
https://github.com/ruby/timeout/commit/683fdb45ee
|
|
https://github.com/ruby/timeout/commit/301ad4cfdc
|
|
https://github.com/ruby/timeout/commit/a65e49cc31
|
|
https://github.com/ruby/timeout/commit/413194f8d2
|
|
(https://github.com/ruby/timeout/pull/30)
throw/catch is used for non-local control flow, not for exceptional situations.
For exceptional situations, raise should be used instead. A timeout is an
exceptional situation, so it should use raise, not throw/catch.
Timeout's implementation that uses throw/catch internally causes serious problems.
Consider the following code:
```ruby
def handle_exceptions
yield
rescue Exception => exc
handle_error # e.g. ROLLBACK for databases
raise
ensure
handle_exit unless exc # e.g. COMMIT for databases
end
Timeout.timeout(1) do
handle_exceptions do
do_something
end
end
```
This kind of design ensures that all exceptions are handled as errors, and
ensures that all exits (normal exit, early return, throw/catch) are not
handled as errors. With Timeout's throw/catch implementation, this type of
code does not work, since a timeout triggers the normal exit path.
See https://github.com/rails/rails/pull/29333 for an example of the damage
Timeout's design has caused the Rails ecosystem.
This switches Timeout.timeout to use raise/rescue internally. It adds a
Timeout::ExitException subclass of exception for the internal raise/rescue,
which Timeout.timeout will convert to Timeout::Error for backwards
compatibility. Timeout::Error remains a subclass of RuntimeError.
This is how timeout used to work in Ruby 2.0. It was changed in Ruby 2.1,
after discussion in [Bug #8730] (commit
https://github.com/ruby/timeout/commit/238c003c921e in the timeout repository). I
think the change from using raise/rescue to using throw/catch has caused
significant harm to the Ruby ecosystem at large, and reverting it is
the most sensible choice.
From the translation of [Bug #8730], it appears the issue was that
someone could rescue Exception and not reraise the exception, causing
timeout errors to be swallowed. However, such code is broken anyway.
Using throw/catch causes far worse problems, because then it becomes
impossible to differentiate between normal control flow and exceptional
control flow.
Also related to this is [Bug #11344], which changed how
Thread.handle_interrupt interacted with Timeout.
https://github.com/ruby/timeout/commit/f16545abe6
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
https://github.com/ruby/timeout/commit/e1b2448101
|
|
Don't move the timer_thread to ThreadGroup::Default, when it's
created in an enclosed ThreadGroup.
Prevents the exception: "add" can't move from the enclosed thread group"
https://github.com/ruby/timeout/commit/eb889d2c8b
|
|
https://github.com/ruby/timeout/commit/4941e8c871
|
|
Otherwise the timeout thread would be added to the ThreadGroup of the thread that makes the first call to Timeout.timeout .
Fixes bug 19020: https://bugs.ruby-lang.org/issues/19020
Add a test case to make sure the common thread doesn't leak to another ThreadGroup
https://github.com/ruby/timeout/commit/c4f1385c9a
|
|
https://github.com/ruby/timeout/commit/5594ae2f4d
|
|
`timeout 0.3.0` broke our test suite because we have some
tests that stubs `Process.clock_gettime` making it return
a value in the past, causing `Timeout` to trigger almost immediately.
I beleive it wasn't a problem before because it was relying on `Process.sleep`.
https://github.com/ruby/timeout/commit/e5911a303e
|
|
https://github.com/ruby/timeout/commit/f3a31abdfb
|
|
https://github.com/ruby/timeout/commit/9a9b03b44c
|
|
https://github.com/ruby/timeout/commit/f69f954a94
|
|
* It's already checked inside #interrupt.
https://github.com/ruby/timeout/commit/5f43254f81
|
|
* So it is trivially correct.
* Performance seems the same overall.
https://github.com/ruby/timeout/commit/5e0d8e1637
|
|
https://github.com/ruby/timeout/commit/4baee63b9b
|
|
https://github.com/ruby/timeout/commit/2bafc458f1
|
|
https://github.com/ruby/timeout/commit/02e792ddd8
|
|
https://github.com/ruby/timeout/commit/ac7b010c41
|
|
exists
https://github.com/ruby/timeout/commit/4893cde0ed
|
|
Idea from nobu.
https://github.com/ruby/timeout/commit/aecdaa23b3
|
|
ignore arguments
This makes:
raise(Timeout::Error.new("hello"), "world")
raise a TimeoutError instance with "world" as the message instead
of "hello", for consistency with other Ruby exception classes.
This required some internal changes to keep the tests passing.
Fixes [Bug #17812]
https://github.com/ruby/timeout/commit/952154dbf9
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4173
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4173
|
|
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
Notes:
Merged: https://github.com/ruby/ruby/pull/4173
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/4173
|
|
https://github.com/ruby/timeout/commit/f9a9758a41
|