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

Fix arguments for ::Process::daemon patch #905

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

andyw8
Copy link
Contributor

@andyw8 andyw8 commented Feb 22, 2023

As discussed here:
699a31e#r94469355

The following repo demonstrates the problem:
https://github.com/andyw8/replicate-debug-daemon-patch-issue

% BACKGROUND=1 QUEUE=* bundle exec rake resque:work
rake aborted!
ArgumentError: wrong number of arguments (given 1, expected 0)
/Users/andyw8/.gem/ruby/3.1.1/gems/debug-1.7.1/lib/debug/session.rb:2441:in `daemon'
/Users/andyw8/.gem/ruby/3.1.1/gems/resque-2.4.0/lib/resque/worker.rb:170:in `prepare'
/Users/andyw8/.gem/ruby/3.1.1/gems/resque-2.4.0/lib/resque/tasks.rb:18:in `block (2 levels) in <main>'

In this branch, the Gemfile is updated to point to this PR:
https://github.com/andyw8/replicate-debug-daemon-patch-issue/tree/andyw8/fix-process-daemon-patch:

% BACKGROUND=1 QUEUE=* bundle exec rake resque:work
DEBUGGER: Can't debug the code after Process.daemon locally. Use the remote debugging feature.

@andyw8 andyw8 force-pushed the andyw8/fix-process-daemon-patch branch from 829d0d3 to 429cbf6 Compare February 22, 2023 20:50
<<~'RUBY'
1| trap(:HUP, 'IGNORE')
2| puts 'Daemon starting'
3| Process.daemon(false, false)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyw8 andyw8 marked this pull request as ready for review February 22, 2023 20:53
andyw8 referenced this pull request Feb 22, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@ajaya
Copy link

ajaya commented Feb 22, 2023

Thank you. This is terrific.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
# Ignore SIGHUP since the test debuggee receives SIGHUP after Process.daemon.
# When manualy debugging a daemon, it doesn't receive SIGHUP.
# I don't know why.
<<~'RUBY'
program = <<~'RUBY'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed this to match the pattern already in use elsewhere.

@ko1 ko1 merged commit cb371de into ruby:master Mar 7, 2023
@ko1
Copy link
Collaborator

ko1 commented Mar 7, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants