async exception safety for external special remote processes
Since an external process can be in the middle of some operation when an async exception is received, it has to be shut down then. Using cleanupProcess will close its IO handles and send it a SIGTERM. If a special remote choses to catch SIGTERM, it's fine for it to do some cleanup then, but until it finishes, git-annex will be blocked waiting for it. If a special remote blocked SIGTERM, it would cause a hang. Mentioned in docs. Also, in passing, fixed a FD leak, it was not closing the error handle when shutting down the external. In practice that didn't matter before because it was only run when git-annex was itself shutting down, but now that it can run on exception, it would have been a problem.
This commit is contained in:
parent
a294a27f9d
commit
a49d300545
4 changed files with 37 additions and 15 deletions
|
@ -403,6 +403,13 @@ remote.
|
|||
git-annex will not talk to it any further. If the program receives
|
||||
an ERROR from git-annex, it can exit with its own ERROR.
|
||||
|
||||
## signals
|
||||
|
||||
The external special remote program should not block SIGINT, or SIGTERM.
|
||||
Doing so may cause git-annex to hang waiting on it to exit.
|
||||
Of course it's ok to catch those signals and do some necessary cleanup
|
||||
before exiting.
|
||||
|
||||
## long running network connections
|
||||
|
||||
Since an external special remote is started only when git-annex needs to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue