libstore: abort all transfers when shutting down curl thread
waiting for them to finish leaves us prone to deadlocking, e.g. if some active transfers is blocked and hasn't been destroyed before our thread was asked to exit. aborting transfers is the safer option here; even if we cause use after frees we'll at least have a crash, not hang forever. Change-Id: I333dcced810e8a85e2ded1f377962a0176798098
This commit is contained in:
@@ -654,9 +654,10 @@ struct curlFileTransfer : public FileTransfer
|
||||
}
|
||||
}
|
||||
|
||||
// only exit when all transfers are done (which will happen through the
|
||||
// progress callback issuing an abort in the case of user interruption)
|
||||
if (items.empty() && quit) {
|
||||
// exit immediately and abort all running transfers. waiting for transfers to finish
|
||||
// before exiting this loop may hang the shutdown procedure forever, e.g. if blocked
|
||||
// transfers would be destroyed (thus aborted) after the curl thread for any reason.
|
||||
if (quit) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user