Skip to content

[uc] Prevent PHP request to get killed when using fclose callback (#26775)#3157

Merged
MorrisJobke merged 1 commit into
masterfrom
fcloseafterkill
Jan 23, 2017
Merged

[uc] Prevent PHP request to get killed when using fclose callback (#26775)#3157
MorrisJobke merged 1 commit into
masterfrom
fcloseafterkill

Conversation

@icewind1991

Copy link
Copy Markdown
Member
  • Prevent PHP request to get killed when using fclose callback
  • Add ignore_user_abort everywhere where the time limit is set to 0

From owncloud/core#26775

For #1166

@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Jan 19, 2017
@icewind1991 icewind1991 added this to the Nextcloud 12.0 milestone Jan 19, 2017

@MorrisJobke MorrisJobke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested together with #3160

if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) {
$unlockLater = true;
// make sure our unlocking callback will still be called if connection is aborted
ignore_user_abort(true);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this later on?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think there is a reliable way to do that, since multiple streams can be opened at the same time and there is no clean way to tell when all of them are closed

@blizzz

blizzz commented Jan 23, 2017

Copy link
Copy Markdown
Member

commit signoff missing

* Prevent PHP request to get killed when using fclose callback

* Add ignore_user_abort everywhere where the time limit is set to 0

Signed-off-by: Robin Appelman <robin@icewind.nl>
@MorrisJobke MorrisJobke merged commit 9b0c6c0 into master Jan 23, 2017
@MorrisJobke MorrisJobke deleted the fcloseafterkill branch January 23, 2017 19:51
@MorrisJobke

Copy link
Copy Markdown
Member

@karlitschek Backport for #1166?

@karlitschek

Copy link
Copy Markdown
Member

please backport

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants