-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Apologies that this is slightly duplicative of #56, #87, but I figured I would share all of the issues that I'm experiencing when using rbtrace specifically with Puma. Maybe fixed by #86 but I'm unable to successfully build that (probably a me problem).
When booting Puma in single mode (e.g. no separate workers, one process), and in Development mode. All of these are using the command:
rbtrace --pid=<PID> --timeout=60 --eval true
First attempt:
- I try to connect via
rbtracebefore Puma receives its first web request, I receiveError: argument --pid (pid is not listening for messages, did yourequire "rbtrace"). - Then, if I make a web request, and then connect via
rbtraceI get:Error: argument --pid (process already being traced?) - Then, if I connect via
rbtraceand then immediately reload the browser multiple times, I get:*** process 54112 is already being traced (54398 != 54484) - And then I try to connect again and get
/Users/bensheldon/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rbtrace-0.5.1/lib/rbtrace/rbtracer.rb:48:in `bind': Address already in use - bind(2) for /tmp/rbtrace-56790.sock (Errno::EADDRINUSE) from /Users/bensheldon/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rbtrace-0.5.1/lib/rbtrace/rbtracer.rb:48:in `initialize' from /Users/bensheldon/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rbtrace-0.5.1/lib/rbtrace/cli.rb:428:in `new' from /Users/bensheldon/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rbtrace-0.5.1/lib/rbtrace/cli.rb:428:in `run' from /Users/bensheldon/.rbenv/versions/3.3.1/lib/ruby/gems/3.3.0/gems/rbtrace-0.5.1/bin/rbtrace:5:in `<top (required)>' from /Users/bensheldon/.rbenv/versions/3.3.1/bin/rbtrace:25:in `load' from /Users/bensheldon/.rbenv/versions/3.3.1/bin/rbtrace:25:in `<main>' - At this point, there is no receovery without restarting the process.
Trying a second time:
- I first make a web request to Puma after starting the process
- I run try to connect with
rbtracewhile also hammering Browser Refresh and getError: argument --pid (pid is not listening for messages, did yourequire "rbtrace"`). - I try again to connect, while also hammering Browser Refresh...
*** attached to process 54900🎉 - ....it hangs for that 60 second timeout....
*** timed out waiting for eval response☹️
Trying a third time:
-
In this case, I try to connect while also continuously hammering Browser Refresh:
*** attached to process 54900 >> true => true *** detached from process 54900
🎉 🎉 🎉
Observation: For reasons I don't know, the Puma process requires continual web requests to allow it to be connected to, and to subsequently complete and detach. Otherwise it gets left in a bad state that prevents further connections without restarting the process.