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

Don't modify SIGCHLD handler when using async mode #16

Closed
wants to merge 1 commit into from

Conversation

hoytech
Copy link
Contributor

@hoytech hoytech commented Jan 19, 2016

  • When I am using async mode and the EV event loop, I wasn't being
    notified of process exits via the condition variable returned by
    AnyEvent::Util::run_cmd(... $ssh->make_remote_command ...).
  • After applying this patch, I am immediately notified when (for example)
    the ssh connection is lost.
  • I believe that the other locations in the file that install SIGCHLD
    handlers would also break EV's child handlers, but this doesn't affect
    my use-case since after the SSH object is constructed I only use
    $ssh->make_remote_command().

- When I am using async mode and the EV event loop, I wasn't being
  notified of process exits via the condition variable returned by
  AnyEvent::Util::run_cmd(... $ssh->make_remote_command ...).

- After applying this path, I am immediately notified when (for example)
  the ssh connection is lost.

- I believe that the other locations in the file that install SIGCHLD
  handlers would also break EV's child handlers, but this doesn't affect
  my use-case since after the SSH object is constructed I only use
  $ssh->make_remote_command().
@salva
Copy link
Owner

salva commented Jan 20, 2016

I have applied your change with some additional checks for the deactivation of the $SIG{CHLD} localization when it is already been used by the main program.

local $SIG{CHLD} = sub {} is just an ugly hack used to break from restartable syscalls.

@salva salva closed this Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants