Fix stream becoming readable again#503
Conversation
|
I think I understand what the problem is; I need to think more about the solution though |
|
@squaremo sorry for the ping, but do you have any update? :-) |
|
@squaremo anything I could do to help moving this forward? |
|
Right I see, the problem is that (as you say) a stream can be added back into Your fix restores the invariant by putting another loop around the problematic loop, to catch the case where the loop exits but the stream has been added back by the 'readable' event handler. I think another way to fix it would be to simply remove the special case for when there's a single stream. Since that loop will only exit when |
f7245ed to
81dfba0
Compare
81dfba0 to
eaebbd9
Compare
|
Sorry for the late response @squaremo, but now updated the PR with your suggestion and it still works for us 👍 |
|
@squaremo sorry for the ping, but is there anything else required here? |
squaremo
left a comment
There was a problem hiding this comment.
Thank you for figuring this out @johanneswuerbach! It's nice that it ended up removing code too 🍫
|
@squaremo thank you for the support. Could you also release a new version with this fix? That would be wonderful. |
|
@squaremo can you please publish a release with this fix? |
|
Why it had no changelog update? |
I'm not really sure how to test this for real, but under constant publishing I can trigger an occasional
Uncaught AssertionError [ERR_ASSERTION]: 0 == 1https://github.com/squaremo/amqp.node/blob/c28c176dd74565c73957eebf00932a892d2aa840/lib/mux.js#L92It seems that some kind of stream in this library is emitting
readable, during read calls and causing this assertion to trip.