-
Notifications
You must be signed in to change notification settings - Fork 51
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
FIX unhandled promises on transport.send() #289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
In this particular case it slipped through - the correct handling of the error was elsewhere but those promises were forgotten :( |
In case it is not clear, these promises fail when the socket already failed, which is handled by the transport implementation. The rejections of the write are typically subsequent to this and can be safely ignored, as the client will enter its reconnect logic. As usual, this is core NATS so it is at most once delivery. For deno the detection happens on a read error For node/websocket the event handlers on the socket deal with it |
@aricart A more attractive solution would be to create an error event and emit such errors so that they can always be logged and processed if necessary. |
The disconnect is reported via the status mechanism. If your app requires to know if your messages arrived, you use request reply. |
Hi @aricart I have this error:
Could it be that the |
@arjenvdhave that one is in catch but not awaited, may need to modify the transport interface. - really want to know when that fails right there. |
Yep me to :) Other services using the same setup don't have this issue. |
@arjenvdhave the network overlay is possibly the problem, right now trying to remove the async nature of send - as I am interested in a possible exception that happens as part of the write operation, but not the actual write succeeding... |
I hacked the
And after that it retries and connects without issues |
@aricart i can reproduce the issues on my cluster. I however do use the nats-js lib, not this deno directly |
@arjenvdhave give me a few, posting the branch for the deno side, now need to change the usage on nats.js |
These could bubble up and be trapped by the runtime, resulting in the client crashing.
FIXES #271