Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Filesystem under load occasionally reports mounted files as not existing #2870
When multiple processes are running in a tight loop that is checking if a file exists and reading it, the file should never be reported as not existing, assuming that the file is not accidentally deleted by another process.
Node code (and likely other code as well, though I haven't yet tested other languages) that does what's described above will occasionally see that the file in question does not exist, even though it definitely does.
This bug was observed when I was trying to compile the same EJS template in several worker processes at once. I observed that occasionally, one of the
Eventually, I determined that this failure only occurred if the following conditions
If either of those conditions are broken (the code was run directly on the host, the file exists in the image itself, or Docker is run on a Windows/Linux machine), then the bug disappears. For this reason, I believe the bug is with Docker for Mac, and not Node or EJS.
Diagnostic ID: 15D5E555-47BB-4C80-9B0C-BEFAF3F272AF
Steps to reproduce the behavior
I was able to reproduce this case with a simple program that spawns two children with the
Given that the reproducible case requires more than just a simple Dockerfile (several other files, dependencies, and a specific folder), I have set up a self-contained example in the repo at https://github.com/nwalters512/docker-file-bug. I've copy-pasted the Dockerfile and Node code here.
@nwalters512 thanks again for the detailed report and repro case -- it was very useful.
I've found and fixed a race condition in
If you'd like to try a development build, this one should have the fix: https://download-stage.docker.com/mac/bysha1/d2e134eea43e57a7fe7234add9dfa1eef984761c/Docker.dmg On my machine your test passes with the fix, and reliably fails without it. Note that this build only suitable for testing, not production.
The fix should be released in the next edge build, due early next week.
Thanks again for your report!
Issues go stale after 90d of inactivity.
Prevent issues from auto-closing with an
If this issue is safe to close now please do so.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.