You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux nats-0 5.10.213-201.855.amzn2.aarch64 #1 SMP Mon Mar 25 18:16:08 UTC 2024 aarch64 Linux
Three replica cluster on k8s.
Steps to reproduce
This is harder to really specify since it happens randomly. But the root of the cause is the byte sequence returned in msg.data within the async handle callback function tries to load the payload as JSON and fails because it gets back from the server b'' instead of valid JSON:
150 try:
151 resp = json.loads(msg.data)
152 if 'error' in resp:
153 err = nats.js.errors.APIError.from_error(resp['error'])
154 future.set_exception(err)
155 return
156
157 ack = api.PubAck.from_response(resp)
158 future.set_result(ack)
159 except (asyncio.CancelledError, asyncio.InvalidStateError):
160 pass```
So what's interesting is the assumption that `json.loads()` here will always succeed since `json.decoder.JSONDecodeError` could be thrown but uncaught (at least here).
The text was updated successfully, but these errors were encountered:
Observed behavior
While publishing valid JSON to a stream, the
nats
client throws an exception:Expected behavior
I expect the message to be sent to the stream and delivered to the correct consumer.
Server and client version
Host environment
Linux nats-0 5.10.213-201.855.amzn2.aarch64 #1 SMP Mon Mar 25 18:16:08 UTC 2024 aarch64 Linux
Three replica cluster on k8s.
Steps to reproduce
This is harder to really specify since it happens randomly. But the root of the cause is the byte sequence returned in
msg.data
within the async handle callback function tries to load the payload as JSON and fails because it gets back from the serverb''
instead of valid JSON:The text was updated successfully, but these errors were encountered: