Bug 2499 - rsync fails to exit when run from an environment with a signal mask
Summary: rsync fails to exit when run from an environment with a signal mask
Status: CLOSED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.5
Hardware: All Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-20 11:57 UTC by Andrew Gaffney
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gaffney 2005-03-20 11:57:45 UTC
I've encountered the problem where running rsync (client) from a child thread in
python causes rsync to complete the sync but never exit. After a lot of
debugging and frustration, it seems that python blocks all signals for any child
threads it creates. This has the side effect of blocking signals for all
processes that are fork()d and/or exec()d from that child thread.

While I would consider this instance a python bug (that is being fixed), it
might still be a good idea for rsync to defensively set a proper signal mask
since it relies on signals to communicate between the parent and child rsync
process.
Comment 1 Wayne Davison 2005-05-16 09:57:52 UTC
Fixing this means adding some new configure checks to determine the
signal-masking function that are available.  Because of this, I have been
leaning toward making some larger changes to convert rsync over to using POSIX
signal-handling functions (with compatibility functions for systems that need
them).  Thus, this will not get implemented until after the 2.6.5 bug-fix release.
Comment 2 Andrew Gaffney 2005-09-21 09:01:20 UTC
I see rsync 2.6.6 is out. Any chance this made it in?
Comment 3 Wayne Davison 2005-09-21 15:44:09 UTC
No.  2.6.6 was a bug-fix release, and thus wasn't an appropriate time to make
the big changes mentioned in comment #1.  If someone would like to work on this,
let me know.  Otherwise I'll get around to it eventually.
Comment 4 Wayne Davison 2006-02-01 19:47:32 UTC
OK, I just checked in some changes that make rsync use sigaction() and sigprocmask() if they are available (otherwise signal() continues to be used).