- Issue created by @adam-vessey
- π³πΏNew Zealand quietone
Changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies β .
- π·πΊRussia Chi
Facing same issue when trying to acquire non-blocking lock.
Change unrecognized operations in LocalStream::stream_lock() to return FALSE;
Do we really need to check the operation ourselves? flock will return the correct error message if the operation is not permitted.
> \flock(\fopen('/tmp/test', 'wb'), LOCK_NB); ValueError flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN.
- π·πΊRussia Chi
Do we really need to check the operation ourselves?
Well, that actually was already noted many years ago.
https://www.drupal.org/project/drupal/issues/1308054#comment-6772280 β - Merge request !11782#3493632: Do not check lock operations in Local stream wrapper β (Open) created by Chi
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
kim.pepper β changed the visibility of the branch 3493632-flock-operations to hidden.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Review the code changes and it makes sense to me. Unfortunately we don't have any test coverage. It would be helpful to add tests to demonstrate the bug is fixed. NW for that.
- π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Updated the IS saying we propose to return
FALSE
for unknown operations. - π¦πΊAustralia kim.pepper πββοΈπ¦πΊSydney, Australia
Attempted to write a test for this, but couldn't work out why the invalid operation was not being passed through to
\Drupal\Core\StreamWrapper\LocalStream::stream_lock()
correctly. π€ - π·πΊRussia Chi
We might need to update this method in LocalReadOnlyStream as well.