after_fork_parent method waits for all child processes to stop
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Start at lib/debug/local.rb lines 106-107 and inspect after_fork_parent, then reproduce the behavior with the Gemfile and test_daemon.rb example using daemons. Confirm the forked worker behavior from the issue's ps output; done means child processes other than debug no longer remain blocked waiting to stop.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Your environment
ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]rdbg -v: rdbg 1.9.2
Describe the bug
I'm using delayed_job.
When I tried to increase the number of workers, the number of workers did not increase because the child process did not stop.
The problem was due to Process.waitpid below.
https://github.com/ruby/debug/blob/master/lib/debug/local.rb#L106-L107
To Reproduce
delayed_job uses daemons.
Script:
Gemfile
# frozen_string_literal: true
source "https://rubygems.org"
gem "debug", platforms: %i[ mri windows ]
gem "daemons"
test_daemon.rb
#!/usr/bin/env ruby
require 'bundler/setup'
Bundler.setup
require 'debug'
require 'daemons'
2.times do |i|
Daemons.run_proc("test_daemon.#{i}") do
loop do
end
end
end
Terminal:
$ test_daemon.rb start
Child processes do not stop and workers do not increase.
$ ps aux
--snip--
sada 14719 1.8 0.2 177232 37168 pts/6 Sl+ 17:01 0:00 ruby ./test_daemon.rb start
sada 14735 0.0 0.2 177232 33832 ? Ssl 17:01 0:00 ruby ./test_daemon.rb start
sada 14737 94.6 0.2 180308 37540 ? Rl 17:01 0:08 test_daemon.0
The following fork operations are no longer possible.
- Forks another child process and exits first child. This prevents the potential of acquiring a controlling terminal.
Also, in Rails development, debug is loaded by default, When starting delayed_job, unexpected block is caused by this issue.
Expected behavior
Child processes other than debug do not wait to stop.
- Langage dominant
- Ruby
- Étoiles
- 1.3k
- Forks
- 146
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir 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é 3/5 1-2 jours Accessibilité débutants 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAP Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
-
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é 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
バグ
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
-
Version bump for OpenVox 9 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
voxpupuli/puppet-epel#186 · 1 commentaire ·
-
external_created_at is no longer used for the message timestamp since the new message UI (v4.4.0) OuverteBug Frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100