-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Concurrency directory creation #1678
Comments
Oh we did check for concurrency but I think there is a missing |
Hm no sorry.. PHP shouldn't cache the fact that a file is missing, so I don't quite see how this code can fail monolog/src/Monolog/Handler/StreamHandler.php Lines 193 to 198 in 60ad518
If mkdir failed, it checks for is_dir again and if the failure reason is Is it possible that your concurrent test runs create the dir, log, and then delete the dir very quickly so you can run into a race condition where mkdir fails but is_dir still returns false as it was deleted already? If so maybe we could fix this by retrying if it is still missing and the error is |
Retry seem like a realy good option here @Seldaek. |
@Legion112 I'm not sure this fixes anything in fact.. As per my comment on #1683 (comment) - I believe you may then run into another race condition whereas the directory gets wiped by another process and then the file write fails. The only real solution if you do clear the directory after the test is to run tests in different directories IMO. |
@Seldaek well let's check if |
Maybe.. but if it exists why did is_dir() return false at line 196? Do you have a reliable way to reproduce the error so that we can try to inspect things further? |
I don't know why |
These are all just band-aids though, not fixes. I would really like to understand what is going on before doing anything that hides the problem. |
We could try to look at is_dir |
What environment are you running this on? VM? virtual filesystem? etc? |
Docker container. |
The stat cache is only for true result, so if is_dir returns true it will cache it, if false it doesn't cache, so that can't be it. k8s / docker yeah sounds like that shouldn't cause weird issues like VMs but who knows. |
Monolog version 2.4.0
We run test in parallel in sometimes we experience following behaviour:
This is from
\Monolog\Handler\StreamHandler::createDir
The text was updated successfully, but these errors were encountered: