dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.98k stars 296 forks source link

Frequent 503 errors when pushing from Symfony to Mercure #231

Closed lostfocus closed 4 years ago

lostfocus commented 4 years ago

We have a Symfony 4.4 project and connect to a Mercure hub within the official Docker container following this documentation: https://symfony.com/doc/4.4/mercure.html

It usually works fine, but at some point we keep getting 'HTTP/2 503' errors when trying to push updates to the Mercure hub. There's nothing I can see in the Mercure log, so what else can be done to find a reason for that error and how to make sure it doesn't happen all the time?

dunglas commented 4 years ago

It looks related to the default connection limits set in the Golang HTTP server: https://stackoverflow.com/a/46740998/1352334

A solution is to provide new configuration options to let the user change these values.

dominicbvm commented 4 years ago

Could this also be a reason that we get an Idle timeout reached error as well? Seems to work well for maybe around a day or so and then needs to be restarted. Not seeing any errors in the logs.

Message: Idle timeout reached for "https://[my-mercure-host]:3000/.well-known/mercure".

0 /app/vendor/symfony/http-client/Response/CurlResponse.php(147): Symfony\Component\HttpClient\Chunk\ErrorChunk->isFirst()

1 /app/vendor/symfony/http-client/Response/ResponseTrait.php(102): Symfony\Component\HttpClient\Response\CurlResponse::Symfony\Component\HttpClient\Response{closure}(Object(Symfony\Component\HttpClient\Response\CurlResponse))

2 /app/vendor/symfony/http-client/Response/CurlResponse.php(205): Symfony\Component\HttpClient\Response\CurlResponse->doGetContent(true)

3 /app/vendor/symfony/mercure/src/Publisher.php(61): Symfony\Component\HttpClient\Response\CurlResponse->getContent()

phakpoom commented 4 years ago

How can i fix this problem for now ?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

BelphegorPrime commented 4 years ago

@dunglas can we expect this issue to be resolved in the near future or does it look more like a 2021 or 2022 deadline?

dunglas commented 4 years ago

Does this problem still occurs with the latest version?

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

indjeto commented 3 years ago

I still experience the issue with the latest version. I'm using mercure_0.12.2_Linux_x86_64.tar.gz on Ubuntu 20.04.3 LTS. It's very annoying. @dunglas is it going to be fixed or need to setup something?

dunglas commented 3 years ago

It's most likely a configuration problem.

Can you open a new issue and copy your config as well as the logs and the errors you get please?