-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 == 1
https://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.