Skip to content

add proper locking to file_put_contents when using streams - #16727

Merged
DeepDiver1975 merged 2 commits into
masterfrom
file-put-content-lock
Jun 15, 2015
Merged

DeepDiver1975 merged 2 commits into
masterfrom
file-put-content-lock

Conversation

@icewind1991

Copy link
Copy Markdown
Contributor

Comment thread lib/private/files/view.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change back to LOCK_SHARED until the post hooks have fired ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure if we want to have a lock around post hooks, there might be valid use cases where a post hooks writes to the file

@icewind1991

Copy link
Copy Markdown
Contributor Author

@icewind1991

Copy link
Copy Markdown
Contributor Author

There was 1 failure:
10:49:17
10:49:17 1) Test\Encryption\ManagerTest::testGetEncryptionModuleUnknown
10:49:17 Failed asserting that exception message 'Module with id: unknown does not exist.' contains 'Module with id: unknown does not exists.'.

Doesn't sound related...

@PVince81

PVince81 commented Jun 3, 2015

Copy link
Copy Markdown
Contributor

The post hook might want to do file-related things like creating/updating versions.
I think the lock needs to be preserved on the file to avoid people moving away the file while the versions are still being processed.

@icewind1991
icewind1991 force-pushed the file-put-content-lock branch from f9dfdd3 to bcf13af Compare June 3, 2015 15:18
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@ghost

ghost commented Jun 3, 2015

Copy link
Copy Markdown

Refer to this link for build results (access rights to CI server needed):
https://ci.owncloud.org//job/pull-request-analyser-ng-simple/12685/
🚀 Test PASSed.🚀
chuck

@icewind1991 icewind1991 added this to the 8.1-current milestone Jun 9, 2015
@icewind1991

Copy link
Copy Markdown
Contributor Author

@DeepDiver1975 @PVince81 can this be merged?

We can discuss whether or not to lock around post hooks seperatly

@PVince81

PVince81 commented Jun 9, 2015

Copy link
Copy Markdown
Contributor

Raised pre-hook discussion here: #16829

👍 for this PR

@PVince81 PVince81 mentioned this pull request Jun 9, 2015
36 of 46 tasks
@icewind1991

Copy link
Copy Markdown
Contributor Author

please review @DeepDiver1975 @MorrisJobke

@DeepDiver1975

Copy link
Copy Markdown
Contributor

👍

DeepDiver1975 added a commit that referenced this pull request Jun 15, 2015
add proper locking to file_put_contents when using streams
@DeepDiver1975
DeepDiver1975 merged commit 911c43e into master Jun 15, 2015
@DeepDiver1975
DeepDiver1975 deleted the file-put-content-lock branch June 15, 2015 12:22
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants