Skip to content
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

Firehose client has no receive timeout, causing it to stall and do nothing sometimes #489

Open
p1timmy opened this issue Dec 6, 2024 · 0 comments

Comments

@p1timmy
Copy link

p1timmy commented Dec 6, 2024

The past week or so around 7am UTC the firehose client in my server has been getting 503 Service Unavailable errors, once those errors stopped coming in the client would stop receiving messages silently after some time. It's frustrating I don't wake up till 5 hours later before I could restart my server and having to wait about an hour or two for my feeds to catch up.

After spending a couple days investigating, I pinned it down to the lack of a timeout value in line 183 (line 257 for async) in atproto_firehose/client.py. Adding in a timeout value (I used 300 seconds/5 minutes) into client.recv() prevented the data stream from stalling forever, it proved effective after last night's 503 Server Unavailable error spam as I didn't have to restart the server manually.

With Bluesky users now making new posts at every single second of the day, I believe adding some timeout value (default or configurable) is necessary to stop feed servers from going out of date without warning. I'm willing to make a PR to address this but not sure what would be the right default timeout value for most use cases or whether or not it should be configurable as a parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant