Server reader thread crashes on exit with Puma in cluster mode
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Reproduce the shutdown exception with the linked clustered Puma example, then inspect debug/server.rb around lines 44 and 511 and the shown Socket unix_server_loop stack. Done means interrupting the server no longer reports reader or session thread exceptions while the debugger Unix socket is cleaned up.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Your environment
ruby -v: ruby 3.3.9 (2025-07-24 revision f5c772fc7c) [x86_64-linux]rdbg -v: rdbg 1.11.0
Describe the bug
When running a Rails server (puma) with RUBY_DEBUG_OPEN=true, it seems to work normally until you stop the server and we have a crash from the server reader thread:
$ RUBY_DEBUG_OPEN=true bin/rails server
DEBUGGER: Debugger can attach via UNIX domain socket (/run/user/1000/rdbg-110109)
=> Booting Puma
=> Rails 8.0.2.1 application starting in development
=> Run `bin/rails server --help` for more startup options
[110109] Puma starting in cluster mode...
[110109] * Puma version: 6.6.1 ("Return to Forever")
[110109] * Ruby version: ruby 3.3.9 (2025-07-24 revision f5c772fc7c) [x86_64-linux]
[110109] * Min threads: 5
[110109] * Max threads: 5
[110109] * Environment: development
[110109] * Master PID: 110109
[110109] * Workers: 1
[110109] * Restarts: (✔) hot (✖) phased (✖) refork
[110109] * Preloading application
[110109] * Listening on http://127.0.0.1:3000
[110109] * Listening on http://[::1]:3000
[110109] Use Ctrl-C to stop
[110109] ! WARNING: Detected running cluster mode with 1 worker.
[110109] ! Running Puma in cluster mode with a single worker is often a misconfiguration.
[110109] ! Consider running Puma in single-mode (workers = 0) in order to reduce memory overhead.
[110109] ! Set the `silence_single_worker_warning` option to silence this warning message.
DEBUGGER[bin/rails#110151]: Debugger can attach via UNIX domain socket (/run/user/1000/rdbg-110109)
[110109] - Worker 0 (PID: 110151) booted in 0.0s, phase: 0
^C[110109] - Gracefully shutting down workers...
[110109] === puma shutdown: 2025-12-08 08:58:00 -0300 ===
[110109] - Goodbye!
Exiting
#<Thread:0x00007fcebcb66df8@DEBUGGER__::Server::reader /home/we/p/we/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/server.rb:44 aborting> terminated with exception (report_on_exception is true):
/home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `unlink': No such file or directory @ apply2files - /run/user/1000/rdbg-110109 (Errno::ENOENT)
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `ensure in unix_server_socket'
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `unix_server_socket'
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1169:in `unix_server_loop'
from /home/we/p/we/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/server.rb:511:in `accept'
from /home/we/p/we/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/server.rb:49:in `block in activate'
#<Thread:0x00007fcebcb66a10@DEBUGGER__::SESSION@server /home/felipe/p/recipal/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/session.rb:179 aborting> terminated with exception (report_on_exception is true):
/home/felipe/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `unlink': No such file or directory @ apply2files - /run/user/1000/rdbg-110109 (Errno::ENOENT)
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `ensure in unix_server_socket'
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1128:in `unix_server_socket'
from /home/we/.rbenv/versions/3.3.9/lib/ruby/3.3.0/socket.rb:1169:in `unix_server_loop'
from /home/we/p/we/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/server.rb:511:in `accept'
from /home/we/p/we/vendor/bundle/ruby/3.3.0/gems/debug-1.11.0/lib/debug/server.rb:49:in `block in activate'
To Reproduce
I've manged to reproduce this running puma in clustered mode here: https://github.com/Draiken/debug-issue-unlink
Basically, start the server, interrupt it, we get the exception.
Expected behavior
No exceptions should occur.
Additional context
I imagine it's a race condition when attempting to remove the debug unix socket.
- Langage dominant
- Ruby
- Étoiles
- 1.3k
- Forks
- 151
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de ruby/debug
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAPPeut-être pris @rira100000000 l’a pris il y a 115 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
-
Missing DAP OutputEvents for debuggee stdout/stderrPeut-être pris @vitallium l’a pris il y a 336 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
Toutes les issues de ruby/debug
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
openfoodfoundation/openfoodnetwork#15070 ·
Les mainteneurs répondent en général sous 2 jours
-
agent:triaged bug bughunt pm:bundler priority:p1 ux
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
SocketDev/socket-patch#2326 ·
Les mainteneurs répondent en général sous 1 jour
-
Remove sidekiq trace filteringOuverteinstrumentation-sidekiq
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
open-telemetry/opentelemetry-ruby-contrib#2735 ·
Les mainteneurs répondent en général sous 2 jours
-
Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
majorsilence/Reporting#703 ·
Les mainteneurs répondent en général sous 1 jour
-
SecureRandom.alphanumeric can silently return an empty or wrong-length secret instead of raisingOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
ruby/securerandom#92 ·