Skip to content
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

ThreadsWait ignoring report_on_exception = false #6897

Closed
NC-piercej opened this issue Oct 18, 2021 · 4 comments
Closed

ThreadsWait ignoring report_on_exception = false #6897

NC-piercej opened this issue Oct 18, 2021 · 4 comments

Comments

@NC-piercej
Copy link

Environment Information

  • JRuby version: 9.3.1.0
  • Operating system and platform: Linux 9a933b6ff814 5.10.47-linuxkit break script engine #1 SMP Sat Jul 3 21:51:47 UTC 2021 x86_64 GNU/Linux

Example

require 'thwait'

thread = Thread.new do
   Thread.current.report_on_exception = false
   raise "whoops"
end

ThreadsWait.all_waits(thread)

Expected Behavior

No report_on_exception warning is raised.

Actual Behavior

We get an unexpected log like:

warning: thread "Ruby-0-Thread-2: /opt/jruby/lib/ruby/stdlib/thwait.rb:91" terminated with exception (report_on_exception is true):
RuntimeError: whoops
  evaluate_ruby at (pry):1

NOTE:

Seems like there are plans to not include thwait by default to match Ruby 2.7 behavior: #6464

We probably want this fixed for the JRuby version of them, however.

@ahorek
Copy link
Contributor

ahorek commented Oct 19, 2021

it raises a warning on 9.2.19.0, but on 9.3.0.0 and 9.3.1.0 it seems to work correctly.

@NC-piercej could you confirm?

@NC-piercej
Copy link
Author

I can confirm that the official thwait gem does NOT have this issue. Given that thwait will no longer be bundled when JRuby reaches 2.7 compatibility... perhaps this can be closed?

@ahorek
Copy link
Contributor

ahorek commented Oct 19, 2021

aha, it was a bug in the library https://bugs.ruby-lang.org/issues/15644

jruby 9.3 still targets 2.6.x compatibility and it was shipped with the previous version 0.1.0 (before the fix) https://github.com/ruby/ruby/blob/ruby_2_6/lib/thwait/version.rb

since 2.7.x thwait is no longer part of the stdlib. So I think this issue can be closed.

@ahorek ahorek closed this as completed Oct 19, 2021
@headius
Copy link
Member

headius commented Oct 21, 2021

@NC-piercej @ahorek Thanks for the investigation!

@headius headius added this to the Invalid or Duplicate milestone Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants