Closed johanneswuerbach closed 1 year ago
Debugging this further it seems that the connection is successfully recovered (it shows up in the rabbitmq management interface), but the channel / consumer isn't 🤔
Thank you for all the tests and this error log. After playing with the tests and looking through your logs, I don't think there is a good solution on the library side, except to maybe improve the logs so it's more obvious what's happening. This error:
declare queue failed: Exception (404) Reason: "NOT_FOUND - queue 'new-builds' in vhost 'platform-development' process is stopped by supervisor
is a queue declaration failure, which is something I don't think we want to be trying to recover from on the library side. You should be debugging your declarations for your application.
is a queue declaration failure
Yes and no. A 404 can also happen while a queue is being moved between queue leaders and can be a temporary failure.
want to be trying to recover from on the library side
This would be fine for us as long as the library returns an error in such cases, so we can exit the process (and have it restarted).
You can programmatically gain access to all of the errors by defining a custom logger, that may help capture the edge case errors.
It feels somehow fairly implicit that a library user needs to implement logic that decides if the library can handle certain errors or not.
Couldn't there be some kind of unrecoverableError
hook, that is called in such situations so I can hard-fail, panic the process?
This way the logic if something is recoverable could be located inside the library. Unrecoverable errors could be all kind of channel failures or failures that have been generally retried more than X times.
We have observed that the module isn't reconnecting in all cases, but still haven't found the specific problem.
Logs from one issue (sorry for the mixture of formats, only the connection manager had a custom logger applied):
Code:
Used version
github.com/wagslane/go-rabbitmq v0.11.0
If you have any pointers what we could look into, that would be appreciated.