Prevent PHP request to get killed when using fclose callback#26775
Conversation
|
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @tanghus and @karakayasemi to be potential reviewers. |
|
should we put this call to all entrypoints where we set the execution time to 0? |
|
Hmm good point. If we set execution time to 0 in these entry points it means we already expect the call to never be killed. |
|
|
Raised #26790 to look into detecting aborted connections and making shortcuts for faster cleanup |
2a4dffc to
cf8c6a1
Compare
|
Rebased, please review. @jvillafanez has voiced some objections here #26790 (comment) |
cf8c6a1 to
5a414b6
Compare
|
Please re-review @butonic @jvillafanez @DeepDiver1975. |
|
No better alternatives, so let's move with this 👍 |
|
stable9.1: #26939 |
|
stable9: #26962 |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
When cancelling a download or closing the connection too quickly after a download, the PHP process might get killed. In these cases the
fclosecode does not run any more and the locks are not released.This workaround adds
ignore_user_abort(true)to tell PHP to continue working even when the connection was closed. This makes sure that resources get freed properly and no weird GC-induced bugs will appear as reported in #22370Related Issue
Partial fix for #22370
Motivation and Context
How Has This Been Tested?
See #22370 (comment).
Need to abort download connections.
Also tested with smashbox: owncloud/smashbox#151
Screenshots (if appropriate):
Types of changes
Checklist:
Backports
Please review @jvillafanez @DeepDiver1975 @VicDeo @PhilippSchaffrath @butonic