-
-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange timeout bug. #265
Comments
Thanks, if possible, are you able to make a MVP failing test case as a PR? This will help me greatly. |
I am confused, here is a shorter version:
Am I doing something wrong? |
The output of the above snippet is:
I can create a PR for this and @ all involved if you'd like. It looks like Regarding the issue itself, while the backtrace notes where the |
To me it seems like a bug. If there is an exception, i need to be able to catch it. My goal is to be able to stop a Fiber from another Fiber. |
It gets weirder, oddly enough. Your example works just fine the moment you remove the custom exception class. It turns out the fact that the caller is a This cannot be caught: require 'async'
Fiber.set_scheduler(Async::Scheduler.new)
class CustomException < Exception
end
fibera = Fiber.schedule do
begin
sleep 5
rescue => e
puts("exception caught")
end
end
Fiber.scheduler.raise(fibera, CustomException) This can, and outputs "exception caught": require 'async'
Fiber.set_scheduler(Async::Scheduler.new)
fibera = Fiber.schedule do
begin
sleep 5
rescue => e
puts("exception caught")
end
end
Fiber.scheduler.raise(fibera, RuntimeError) I'm using Ruby 3.2. I can create the PR if you'd like. Asking because I'm not the OP. |
A
|
Sorry my family has been sick I have not had time to review this issue. |
Yep, that was it. Not a bug at all then, just |
Thanks for the solution! |
This design allows lower-level exceptions, such as |
I have a class which tries to connect on TCP.
When it fails it tries again.
If i try again with TCPSocket.new() before it time outs, i get a strange error message, which does not make any sense to me:
produces:
If i set counter to 1 (sleeping at least 1 sec before retrying, then all is good)
The text was updated successfully, but these errors were encountered: