-
Notifications
You must be signed in to change notification settings - Fork 696
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 Publish and Flush calls to not fail on async error (slow consumer) #158
Conversation
kozlovic
commented
Feb 2, 2016
- Revisited the use of nc.err to limit it to report async errors.
- Publish and Flush calls will no longer fail if an asyn error occurs
- Flush will report an error if connection is closed/lost during flush
- Flush calls are failed during a reconnect
- Tests updated
- Revisited the use of nc.err to limit it to report async errors. - Publish and Flush calls will no longer fail if an asyn error occurs - Flush will report an error if connection is closed/lost during flush - Flush calls are failed during a reconnect - Tests updated
- Don't use returned variable - Compact call with error checking
Fix Publish and Flush calls to not fail on async error (slow consumer)
Guys, can you explain me how we handle error if flush returns error.
Who processes error in nc.err after assignee? Why we don't make a call of processOpErr? My background: I have some microservices which live on different hosts. Nats is mq. I've faced with dropping messages in nats flow and now I'm trying to find all possible cases. I have very low message rate and it's not slow customer. Messages disappear. I make a EncodedConn.Request and don't receive message in subscriber. Subscribtion occurs before publishing. I have just one connection to nats per microservice. So I have to receive message, but...
|
Run the server with -DV, that should help you trace where the messages are being lost. What is the timeout on the request? I have really only seen dropped messages via slow consumers, but if the request timeout is too short that could be a cause. |
Thank you for very quick response! What about error handling for Flush? There are a lot of logic for transmitting error to nc.err and then just ignore it. |
It's not ignored. The code you refer to is the flusher, which is a go-routine. There is no way to return directly the error condition there. So this is done through |
Why we do not do reconnect in the same way like on Read error? |
Well, that's the thing (and discussed in the PR) we let the readLoop do the reconnect (it should get an error on read too if the socket is gone) |