Repository navigation
Commit 63ecd7c
committed
fix: end a zip directory entry through flow control, not a timer
The directory placeholder emitted 'end' from a setImmediate, so the event
fired whether or not the consumer had finished with the entry. A listener
that creates the directory asynchronously would therefore be handed the next
entry, a file inside that directory, before the directory existed, and the
write failed with ENOENT.
That is the intermittent "ENOENT ... /xxx/bar.txt" seen in
test/zip/uncompress_stream.test.js on loaded CI runners. Reproduces every
time by delaying the mkdir in the entry handler.
Push EOF instead, so 'end' arrives only once the consumer reads or resumes
the entry and the ordering no longer depends on timing.1 parent 35ab10c commit 63ecd7c
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
0 commit comments