-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make file cache updates more robust #10397
Conversation
a70f16a
to
deebd55
Compare
deebd55
to
0512d91
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. but I'd love for @icewind1991 to have a look
@schiessle can you rebase so CI can run? |
only update the encrypted version after the write operation is finished and the stream is closed Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
0512d91
to
a9e22c5
Compare
@rullzer done |
I would prefer if it used a (you can use the write callback to set the |
@icewind1991 I agree with you in general. But as I want to backport it to 13 as well I would like to keep the fix as small as possible. Suggestion: Let's merge this for 14 and backport it for 13 and I will do a follow up PR for master (15) to add a CallbackWrapper. |
'encryptedVersion' => 2, | ||
]); | ||
$cache->expects($this->any())->method('get')->willReturn($entry ); | ||
$cache->expects($this->any())->method('update')->with(5, ['encrypted' => 3, 'encryptedVersion' => 3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change this to $this->once()
please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not possible. The stream, created in the method is used in various places. Sometimes the method is never called and some tests uses the instance multiple times so it is used more then once. All I want to make sure is that every time it is called, it should be called with the right parameters.
Sounds good to me |
Let's get this in for the beta3 so that it gets some test coverage... |
@schiessle Could you prepare the backport? |
Only update the encrypted version after the write operation is finished and the stream is closed
With Amazon S3 as primary storage it happened that we tried to update the "encryption version" before the file was added to the file cache which lead to a wrong version number. By updating the version only after the stream was closed I could solve the issue.
@icewind1991 please have a look if this makes sense. Thanks!
fix #8299