-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix atomic createWriteStream #8194
Conversation
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... React HackerNews ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
To avoid introducing a |
This intercepting of the finish event was exactly what the previous broken implementation did. I've now instead overridden the |
6a0bc13
to
85087d9
Compare
Closes #7813
I think this is also the cause of at least some CI flakiness (for tests that use the NodeFS as the output FS).
Problem
(copied from the linked issue)
Probable cause
Solution
So with my limited understanding of Node streams, I don't know if implementing an atomic write stream is even possible (anymore). So the easy (but brute force) solution is to let the callee do call themove
at the right time (which worked out for all usages we have). E.g.It looks like the problem was that
fs-write-stream-atomic
added a wrapperWriteable
"proxy" over the actual fs write stream. Overriding thefs.close
used by Node'screateWriteStream
to additionally move the files afterwards works