-
Notifications
You must be signed in to change notification settings - Fork 21
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
Large messages causes channel to shut down #49
Comments
Try adding the await operator for the publish statement in your code. That will prevent javascript from trying to send the next message before the first message's body is fully written to the socket. E.g., |
That's done on purpose to provoke the error. This error only happens when we load test the whole system, and the code I presented is just a simplification to provoke the same thing. With the await it works, however I tried to not include async sending from multiple clients to simulate the load testing that we do, just to keep the example project small. The data is also just mock data to fill around the same as the production data that is logged during the crash. Just as a note, in the production code we are awaiting the sends
|
I'll just note that I can still reproduce with amqp-client.js v3.0.0 (on both RabbitMQ 3.9.16 used in the example here and RabbitMQ 3.12.1). |
We observed the same issue in prod where we were writing around 140 messages/second. The ingress rate at exchange was around 70 messages/second before we observed the crashes. Currently we are planning to use multiple channels (say While writing a message to the exchange, we plan to use a semaphore1 and round robin the channel and do the We observed that with |
A publish on the AMQP protocol involves sending multiple different frames, the BasicPublish method frame, the Headers frame and then 0 or more Body frames. These frames all have to be sent together or else RabbitMQ will freak out (kind of defeats the purpose of multiplexing but anyway). We One way I guess, if user's won't or can't |
If I understand the clarification of the original issue, the problem occurs during a load test with multiple clients. I imagine the poster means multiple HTTP clients were hitting their application during the test, which in turn published messages to RabbitMQ. The application under test correctly used await but still encountered the problem. The demo application deliberately missed await for the purpose of demonstrating this issue. |
Even if the user doesn't await basicPublish all framed beloging to one publish should be published together. So intead of waiting for a potentially blocked socket to be drain enqueue all data and only await for the last sent frame. Fixes #49
Right, I think the PR #123 should solve for that. |
Thank you @carlhoerberg for the quick turnaround! Will test the PR and let you know! |
We've got a production setup running where we've encountered an issue where the responses causes the server to shut down with the following error:
I've made a repo that replicates this issue consistently, under my profile: https://github.com/2joocy/cloudamqp-frame-issue
The repo contains a very minimal example of sending a message from the same channel a couple times, causing the server to crash. You can edit the connection string to rabbitmq in
app.ts
. The only requirement is that you've runnpm i
and then runnpm start
with the correct connection string.We've used an older library before and didn't have issues, I've set the same test up with https://www.npmjs.com/package/amqplib and the data passes through.
Is this an issue from the library side or should we handle messages differently? Or are there parameters to circumvent this?
The text was updated successfully, but these errors were encountered: