-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Messages hang in pending state when database connection fails #3041
Comments
I think this has been a problem since forever and I am not sure there is an easy solution. This is probably easier to solve now the queue is in the database as opposed to RabbitMQ. Many people find they need to run multiple workers to consume their queue in a timely manner so process identification is tricky as the workers are not able to communicate with each other and I do not think Docker would be able to tell each worker about every other worker. One solution could be a configurable lock retry setting so if locked_at was more than say an hour ago, the message is picked up again. |
Thank you again for the quick responses. Really appreciate it. Might it be an idea to give the database layer some kind of retry-mechanism? Disclaimer: untested code not written by a human ;p
|
Seems to be a duplicate of #3023 |
+1 - this issue also happens to me postal logs:
mariadb logs:
|
Describe the bug
In my 3.3.4 version of Postal I have this problem that the database sometimes loses connection.
Jul 10 08:55:44 post mariadbd[626]: 2024-07-10 6:55:44+0000 482 [Warning] Aborted connection 482 to db: 'unconnected' user: 'postal' host: 'localhost' (Got timeout reading communication packets)
That needs to be fixed on my server... BUT Postal is not able to handle this. The message which the worker is trying to send hangs in pending state after this:
Now the message hangs in pending state because it is still locked by the failing worker process:
The only way to get it through now is setting locked_at and locked_by fields to null.
Expected behaviour
The message should be cleaned properly by the worker so it can be picked up by another process the next time the database is back.
Environment details
The text was updated successfully, but these errors were encountered: