Closed mriedem closed 6 months ago
Thanks @mriedem, I'm not a fan that a KeyError crashed your app so what I will do is to to instead send that error to the async error callback while we are investigating the root cause.
Thanks @mriedem, I'm not a fan that a KeyError crashed your app so what I will do is to to instead send that error to the async error callback while we are investigating the root cause.
Sounds good, thank you for the prompt response. We provide an error_cb
so we'll be sure to log it.
fyi added handling in v2.1.2 release so that error is reported on error callback instead.
fyi added handling in v2.1.2 release so that error is reported on error callback instead.
I see (f8a5c9906dd9dae42f09a9f566ae1bd90ef94cfa), thanks!
Fixed in v2.1.2 https://github.com/nats-io/nats.py/releases/tag/v2.1.2
This issue (#187), or maybe something related, seems to be present still in 2.1.0.
We were hitting some TimeoutErrors in an exponential backoff loop trying to submit a request (network issues presumably). Eventually
request
raised a KeyError, here is a snip of the traceback:I see that #219 changed
pop
to be graceful if the entry wasn't in the dict:And that was reverted in #229, but we can apparently still hit a KeyError here:
https://github.com/nats-io/nats.py/blob/v2.1.0/nats/aio/client.py#L937
I won't profess to understand the internals of the library for how this can happen, but there is apparently still a race condition that's possible here on the latest release. Should this issue be re-opened? Should I open a new issue referencing this one? I don't really want to add KeyError handling in our code calling
request
but it crashed the app so we might need to for the time being.Originally posted by @mriedem in https://github.com/nats-io/nats.py/issues/187#issuecomment-1128941938