socketry / async

An awesome asynchronous event-driven reactor for Ruby.
MIT License
2.05k stars 85 forks source link

Latest version of debug gem causes RuntimeError #225

Closed pbstriker38 closed 1 year ago

pbstriker38 commented 1 year ago

ruby: 3.2.2 async: 2.5.0 debug 1.7.2

This is similar to #157 where it only errors on the first request. A refresh of the page is successful

7.97s     warn: Async::Task [oid=0x1fd4c] [ec=0x1fd60] [pid=39993] [2023-04-03 14:00:37 -0700]
              | Task may have ended with unhandled exception.
              |   RuntimeError: running is given, but running
              |   → /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/thread_client.rb:154 in `set_mode'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/thread_client.rb:879 in `wait_next_action_'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/thread_client.rb:856 in `wait_next_action'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/thread_client.rb:235 in `wait_reply'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/thread_client.rb:239 in `on_load'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/debug-1.7.2/lib/debug/session.rb:140 in `block in initialize'
              |     <internal:/Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb> 37
              |     <internal:/Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb> 37
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32 in `require'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:30 in `require'
              |     app/**/**.rb:28 in `block (2 levels) in get'
              |     app/**/**/async.rb:25 in `block in barrier_task'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-2.5.0/lib/async/task.rb:158 in `block in run'
              |     /Users/pbstriker38/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/async-2.5.0/lib/async/task.rb:310 in `block in schedule'
ioquatix commented 1 year ago

Does it work without the debug gem?

pbstriker38 commented 1 year ago

Yes

ioquatix commented 1 year ago

I believe the debug gem is incompatible with fibers, do you mind filing a bug report with them and linking it to this issue?

pbstriker38 commented 1 year ago

ok. I can do that

pbstriker38 commented 1 year ago

Looks like it's already an open issue

https://github.com/ruby/debug/issues/486

ioquatix commented 1 year ago

Thanks for your report.

The fix is here: https://github.com/ruby/debug/pull/987

This issue cannot be fixed by the async gem.

So I will close it.