mafintosh / end-of-stream

Call a callback when a readable/writable/duplex stream has completed or failed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

intermittent failures

zkat opened this issue · comments

So, I've been seeing random failures recently that were hard to reproduce and I often would dismiss as my own misunderstanding, but as it turns out, it looks like it's not just me: zkat/pacote#143

tl;dr: end-of-stream (used as finished) is closing too soon, but apparently only sometimes. I suspect this might have to do with its priority ordering for events, or it might be something wrong with the underlying streams implementation making things fire in the wrong order.

Either way, the workaround is to manually attach to close, so that seems... significant?

Did you figure this out? Haven't had any issues myself in a long while, but the state machine is prob complicated enough that there could be bugs still.

No, we just worked around it by not using end-of-stream anymore and doing things manually.

👍 That works as well :D