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
Writing multiple files on OS X #3623
Comments
Did you try confirming that it's actually blocking by adding an interval timer that logs to the screen or something? |
@mscdex maybe blocking was the wrong word. My JS thread continues to run. It appears that |
You could set the |
Libuv serializes disk writes on OS X due to a nasty quirk documented here. It's possible newer OS X releases fare better but that hasn't been tested. |
Thank you @bnoordhuis 🙇 |
@speg I see you've commented on reddit. To clarify: the nasty quirk is inside the OS X kernel, not libuv - libuv merely works around the kernel bug. You can find more background here. Maybe calling it "kernel bug" is not quite right - POSIX allows for how OS X behaves, it doesn't say much about the concurrency model w.r.t. positional writes - but it's quality of implementation issue that doesn't affect other Unices and with good reason: it results in rather heinous data corruption. |
I was trying to experiment with my understanding of node and wanted to test a simple assumption:
Node can write to two files at the same time.
Two buffers, filled with zeros. A is very large, B is very small. B should finish first?
On Linux I get:
But on OS X (10.11.1) I get:
A commentor on StackOverflow confirms my Linux results on his Windows machine.
I tried with node 5.0, 4.1, and 0.12 on OS X. All similar results. It looks like
fs.write
is waiting forfileA
to complete untilfileB
can write.Is there a known issue with
fs.write
on OS X?The text was updated successfully, but these errors were encountered: