-
Notifications
You must be signed in to change notification settings - Fork 139
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
100% CPU usage #103
Comments
Hi, we could use a bit more information -
|
While developing an application that has long sleeps in it, I encountered this problem. I eliminated all the external libs one by one, until the connection to rabbit alone remained, and the problem continued. I wanted to write the simplest and shortest possible code, to reproduce the problem, and it turned out that just opening and closing the connection was enough. You can add opening a channel, publishing a message and closing a channel, and the problem will continue to occur, so I would not call it an "artificial scenario" Unfortunately, I do not have time to look for the cause myself |
Now that we have an explanation it's not so artificial 😉 |
The problem stems from the goroutine used for a connection exiting before the connection is established. We don't have code (yet) to take into account scenarios where a connection is abruptly closed. A workaround is to always give the connection time to establish before attempting to cancel it - |
Hello
The above code causes 100% CPU usage after a short while
The problem does not always occur, so you may have to run it several times to reproduce the problem
Strace attached after the problem occurred:
The text was updated successfully, but these errors were encountered: