Warn: mainstream closed while substream was initializing or active
It is logged whenever a substream has the rug pulled from under it's feet before it had time to flush it's buffers.
If the real/main stream was destroyed, there's no flushing occuring and substreams are destroyed as well.
But if the main-stream tries to do a clean exit through stream.end(null, cb),
the end calback should be deferred until all substreams are flushed and closed.
This will enable us to do a graceful exit without warnings.
There's a warning message
It is logged whenever a substream has the rug pulled from under it's feet before it had time to flush it's buffers. If the real/main stream was destroyed, there's no flushing occuring and substreams are destroyed as well.
But if the main-stream tries to do a clean exit through
stream.end(null, cb)
, the end calback should be deferred until all substreams are flushed and closed.This will enable us to do a graceful exit without warnings.