I hit this unreachable!() inside FillBuf with an AsyncRead implementation (wrapped in a BufReader) which calls a Javascript callback thru neon (which is an async operation) for the actual read, which means every "new" poll_read (i.e. either the first call ever or the first call after a Ready is returned) will return Pending at least once, including after EOF is hit, which is what triggers this bug. Of course, the AsyncRead implementation could track when EOF is hit and return Ready(0) forever after that, which is indeed what I used as a workaround, but I can't find anything in the AsyncRead documentation which actually requires implementors to do this.
I hit this
unreachable!()
insideFillBuf
with anAsyncRead
implementation (wrapped in aBufReader
) which calls a Javascript callback thruneon
(which is an async operation) for the actual read, which means every "new"poll_read
(i.e. either the first call ever or the first call after aReady
is returned) will returnPending
at least once, including after EOF is hit, which is what triggers this bug. Of course, theAsyncRead
implementation could track when EOF is hit and returnReady(0)
forever after that, which is indeed what I used as a workaround, but I can't find anything in theAsyncRead
documentation which actually requires implementors to do this.See #2722 for a possible bug fix.