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

Client reconnect on CBORDecodingError creating infinite loop reading frames #95

Closed
joelghill opened this issue Jul 17, 2023 · 12 comments · Fixed by #97
Closed

Client reconnect on CBORDecodingError creating infinite loop reading frames #95

joelghill opened this issue Jul 17, 2023 · 12 comments · Fixed by #97

Comments

@joelghill
Copy link
Contributor

I'm reading from the firehouse using the synchronous client and I am encountering an error when processing a frame. A CBORDecodingError is raised and the logic when handling this error appears to be to reconnect to the feed. The client continues to read from the feed from the initial cursor and shortly after encounters the same unprocessable frame.

The cursor that the error occurs at is just after 93278360

I'm not sure what the solution should be. Should the client reconnect just after the problematic cursor and continue reading the feed, or is there a deeper issue in processing the data that needs to be resolved here?

@MarshalX
Copy link
Owner

What a good catch! Thank you! Yeah, it requires deep research into CBOR decoding that is provided by 3d part lib, but for now, let's ignore frames that could not be decoded. The fix will be included in the next release (v0.0.19)

@MarshalX
Copy link
Owner

MarshalX commented Jul 18, 2023

@joelghill released. pls verify pip install -U atproto

@joelghill
Copy link
Contributor Author

Looks like it's working, thank you!

@MarshalX
Copy link
Owner

all issues are coming from a library that I chose as WS client... i migrated to stable one and all issues are gone! #101 i'll merge it soon

@MarshalX
Copy link
Owner

MarshalX commented Jul 19, 2023

@joelghill let me know if you can install this dev build with the new WS lib to your feed and run it for a few hours. Nothing changed for public API. Only my internals of firehose client impl

atproto-0.0.20.dev3.tar.gz

@joelghill
Copy link
Contributor Author

I'll take a look sometime this evening!

@joelghill
Copy link
Contributor Author

Still playing around with it on my end, but so far I haven't seen any exceptions and it's spinning up far fewer threads in the background. Seems much more stable!

@joelghill
Copy link
Contributor Author

Also , the fan on my laptop is much quieter, so that's also a good sign, haha!

@MarshalX
Copy link
Owner

I also expect that it manages threads much better. But I didn't notice a big performance boost or something like that. That's cool that now we can peacefully decode cbor without frame looses

@MarshalX
Copy link
Owner

Thank you for your tests! I'll include this PR in the next release

@MarshalX
Copy link
Owner

I stay connected to the firehose for 7 hours without any errors. Looks soo stable

@MarshalX
Copy link
Owner

released in v0.0.20

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

Successfully merging a pull request may close this issue.

2 participants