| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/timeout/commit/fef9d07f44
|
|
https://github.com/ruby/timeout/commit/4ae8631acf
|
|
```
Run options:
"--ruby=./miniruby -I../ruby/lib -I. -I.ext/common ../ruby/tool/runruby.rb --extout=.ext -- --disable-gems"
--excludes-dir=../ruby/test/.excludes
--name=!/memory_leak/
--seed=9843
[ 1/31] TestTimeout#test_timeout_in_trap_handler = 0.00 s
1) Error:
TestTimeout#test_timeout_in_trap_handler:
NoMethodError: undefined method 'kill' for nil
/Users/luke/workspace/ruby-dev/ruby/test/test_timeout.rb:9:in 'TestTimeout#kill_timeout_thread'
/Users/luke/workspace/ruby-dev/ruby/test/test_timeout.rb:424:in 'TestTimeout#test_timeout_in_trap_handler'
Finished tests in 2.715032s, 11.4179 tests/s, 52.3014 assertions/s.
31 tests, 142 assertions, 0 failures, 1 errors, 0 skips
ruby -v: ruby 4.0.0dev (2025-12-11T21:56:23Z fix_timeout_test https://github.com/ruby/timeout/commit/1c5eacbf9a) +PRISM [arm64-darwin24]
make: *** [yes-test-all] Error 1
```
https://github.com/ruby/timeout/commit/e5bc1de901
|
|
https://github.com/ruby/timeout/commit/c8d63ce3fe
|
|
Windows has no SIGUSR1.
There might be another usable signal, but this is breaking ruby master
so I just want a quick fix for now.
https://github.com/ruby/timeout/commit/b19043e8d0
|
|
* Fixes https://github.com/ruby/timeout/issues/17
https://github.com/ruby/timeout/commit/1a499a8f96
|
|
* Add tests related to Thread.handle_interrupt
* Fixes https://github.com/ruby/timeout/issues/41
https://github.com/ruby/timeout/commit/a52720e82a
|
|
This reverts commit https://github.com/ruby/timeout/commit/45816b1b2602.
https://github.com/ruby/timeout/commit/b54f91e9dd
|
|
https://github.com/ruby/timeout/commit/4de4b4759c
|
|
* https://github.com/ruby/ruby-dev-builder/actions/runs/19973218359/job/57293388626
https://github.com/ruby/timeout/commit/45816b1b26
|
|
https://github.com/ruby/timeout/commit/82fb6f6925
|
|
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
|
|
This reverts commit https://github.com/ruby/timeout/commit/983cbf636a17, that is
fixed by test-unit 3.7.3.
https://github.com/ruby/timeout/commit/095207f270
|
|
Failed build in #70.
Pre-3.0 versions of Ruby didn't support pattern matching, and power_assert warned.
https://github.com/ruby/timeout/commit/983cbf636a
|
|
This reverts commit ce66eea167847d4300150791bde4932b907b0cc0.
Notes:
Merged: https://github.com/ruby/ruby/pull/12851
|
|
http://ci.rvm.jp/results/trunk-gc-asserts@ruby-sp2-noble-docker/5632508
```
1) Error:
TestEval#test_outer_local_variable_under_gc_compact_stress:
Test::Unit::ProxyError: execution of Test::Unit::CoreAssertions#assert_separately expired timeout (10 sec)
pid 1339179 killed by SIGABRT (signal 6) (core dumped)
```
seems that timeout scale doesn't work even though `RUBY_TEST_TIMEOUT_SCALE`
is specified.
This patch tries to print the timeout with scale information.
Notes:
Merged: https://github.com/ruby/ruby/pull/12849
|
|
https://github.com/ruby/timeout/commit/c6d121aa18
|
|
added tests
https://github.com/ruby/timeout/commit/ffc8d7c003
|
|
type-errror and added tests
https://github.com/ruby/timeout/commit/e8a7dbdb87
|
|
type-errror and added tests
https://github.com/ruby/timeout/commit/8342544979
|
|
This test randomly fails due to the bug reported in [Bug #20314], where
the two timeouts are too close so that they can expire at the same time.
As a workaround, this change increases the time difference between
timeouts. This will reduce the probability of simultaneous expirations
and lower flakiness.
|
|
|
|
https://github.com/ruby/timeout/commit/54bc7639d2
|
|
https://github.com/ruby/timeout/commit/3e42aa4d84
|
|
the caller
(https://github.com/ruby/timeout/pull/34)
* see discussion in
https://github.com/ruby/timeout/pull/30#issuecomment-1616179651
|
|
(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/db017da726
|
|
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
|
|
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/4baee63b9b
|
|
https://github.com/ruby/timeout/commit/2bafc458f1
|
|
https://github.com/ruby/timeout/commit/ec5a614334
|
|
https://github.com/ruby/timeout/commit/1c6bb90aea
|
|
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
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/timeout.rb (Timeout#timeout): add custom error message
argument. [Feature #11650]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
When you change this to true, you may need to add more tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* test/test_timeout.rb (test_rescue_exit, test_custom_exception):
assert with exact messages.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* time: Object#timeout has been deprecated a long time ago, use
Timeout.timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* test/test_timeout.rb (test_custom_exception): assert that the
given exception will raise on timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/timeout.rb (ExitException): removed internal exception class
and use Timeout::Error instead, as using throw/catch to isolate
each timeouts now. [ruby-dev:49179] [Bug #11344]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* test/ruby/test_thread.rb (test_switch_while_busy_loop): move
from test/test_timeout.rb. [Bug #1402]
* test/test_timeout.rb (test_timeout): no longer related to
[Bug #1402]. [Bug #8523]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[Bug #8523]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/timeout.rb (Timeout::ExitException.catch): pass arguments
for new instance.
* lib/timeout.rb (Timeout::ExitException#exception): fallback to
Timeout::Error if couldn't throw. [ruby-dev:47872] [Bug #9380]
* lib/timeout.rb (Timeout#timeout): initialize ExitException with
message for the fallback case.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/timeout.rb (Timeout#timeout): should not rescue ordinarily
raised ExitException, which should not be thrown.
* lib/timeout.rb (Timeout::ExitException.catch): set @thread only if
it ought to be caught.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/timeout.rb (Timeout#timeout): when a custom exception is given,
no instance is needed to be caught, so defer creating new instance
until it is raised. [ruby-core:59511] [Bug #9354]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44516 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|