-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Library error: a socket error occurred #32357
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
Comments
Heartbeats are only used for blocking calls (amqp.consume). Messenger uses basic.get which is non-blocking. So I guess heartsbeats config wouldn't do anything. https://github.com/pdezwart/php-amqp
|
See also #32055 |
As I read, there is no quick "fix" at the moment. How can I auto-ack a message once it's received or ack it manually before executing my python script? This way, if my script throws an exception then I can republish the message for retry. Do you have a code example/configuration? Thanks |
You could try listening on the What's the longer-term fix for this? I'm not an AMQP expert - just someone who accidentally got involved in the Messenger component :). Is the problem basically that we open a connection to AMQP, keep it open while the handler is processing... and eventually that connection fails? If I'm reading the error correctly, it's coming from:
If we're not using |
Valid questions, someone with more experience should help us to answer and clear this out. @Tobion, any thoughts? |
The delivery tag of an envelope is unique per channel. So I don't think you can disconnect after receiving a message, reconnent and then acknowledge because the channel would be different. From our experience the easiest solution is to acknowledge messages first when processing would take too long. This can be done with a listener as Ryan explained. |
So if pre-ack’ing is the solution, we can’t change that to be the default behavior - it’s not what you usually want (because, for example, if your handler caused php to run out of memory, then you would have ack’ed a message that in fact never processed). This leads me to a proposed solution: introduce a stamp that you can add to a message to “opt in” to acknowledging messages immediately. Thoughts? |
Yes I agree that we need a way to enable "auto-ack". What we do so far is having a separate queue that we consume with |
Maybe a generic |
Hey, thanks for your report! |
Friendly ping? Should this still be open? I will close if I don't hear anything. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
This is still happening for me. any real solution found so far? |
I am facing this issue also. It is sometimes occurring but not every time when I am trying to send another message to another queue inside Handler. Any ideas how to fix it? |
Same problem here |
Any solution, anyone? The problem still persists. |
I am also experiencing this issue. Is there a permanent solution yet? |
I have learned so far that, in my situation it wasn't about the duration about the processing of the message, decreasing the prefetch number, in my case If you're also processing messages coming in not from Symfony, skipping |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: 4.3.0
Description
[2019-06-25 21:17:40] console.ERROR: Error thrown while running command "messenger:consume". Message: "Library error: a socket error occurred" {"exception":"[object] (Symfony\Component\Messenger\Exception\TransportException(code: 0): Library error: a socket error occurred at .../vendor/symfony/messenger/Transport/AmqpExt/AmqpReceiver.php:56, AMQPException(code: 0): Library error: a socket error occurred at /data/websites/match.walmeric.com/vendor/symfony/messenger/Transport/AmqpExt/Connection.php:348)","command":"messenger:consume","message":"Library error: a socket error occurred"} []
How to reproduce
In the handler, inside __invoke function, execute something around 10-15 minutes.
Possible Solution
Expose heartbeat value in configuration
Additional context
The consumer executes a Python script that sometimes run for 5, 10 or 30 minutes, so the Messenger component throws a socket error.
Possible related issues
php-amqplib/RabbitMqBundle#301
The text was updated successfully, but these errors were encountered: