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

Send returns no error after broker drops connection #16

Closed
andrewzeneski opened this issue Mar 17, 2014 · 8 comments
Closed

Send returns no error after broker drops connection #16

andrewzeneski opened this issue Mar 17, 2014 · 8 comments
Labels

Comments

@andrewzeneski
Copy link

The first attempt to send after a broker drops the connection returns no [expected] error. Subsequent attempts to send will return an expected error.

@gmallard
Copy link
Owner

Why is this surprising if the time deltas are fairly small?

@gmallard
Copy link
Owner

It is surprising if the time deltas are large. So something seems amiss. No idea at present as to cause. If you have any insight, I would love t hear it.

@gmallard
Copy link
Owner

@andrewzeneski Please correct me if the following is incorrect.

Observed Scenario

  • Manual: Start broker
  • Manual: Start stompngo publisher
  • Publisher: Send message 1
  • Publisher: Start Sleep for 2 minutes
  • Manual: Kill broker
  • Publisher: Send message 2, no error received
  • Publisher: Start Sleep for 2 minutes
  • Publisher: Send message 3, receive error (broken pipe)

Expected Scenario

  • Manual: Start broker
  • Manual: Start stompngo publisher
  • Publisher: Send message 1
  • Publisher: Start Sleep for 2 minutes
  • Manual: Kill broker
  • Publisher: Send message 2, receive error (broken pipe)

@andrewzeneski
Copy link
Author

@gmallard: That is correct. In my testing the "sleep" time was more in
seconds than minutes though. I don't think it should matter how long the
broker is down, if the connection is dropped an error should be returned so
the application has a chance to handle the fact the message wasn't sent as
it sees fit.

@gmallard
Copy link
Owner

Thanks.

Some notes for posterity.

This behavior is somewhat broker dependent.

I observe the unexpected behavior with:

  • ActiveMQ
  • RabbitMQ
  • stompserver_ng

Strangely, I observe the expected behavior with:

  • Apollo

I believe I can bypass the unexpected behavior with a little more due diligence (and overhead) in stompngo's writer goroutine. More on this later.

I continue to think that timings can make a difference here. If client is sending every 100 nano-seconds, and a broker crashes, it seems likely that it will take several 'send cycles' for the client TCP system to even note that the connection is 'gone'.

Also note that different scenarios, e.g. a cut or unplugged wire will cause totally different behavior.

gmallard added a commit that referenced this issue Mar 20, 2014
@gmallard
Copy link
Owner

@andrewzeneski Plese try a system built with the HEAD of current 'dev' branch: e43869f

@gmallard
Copy link
Owner

gmallard commented Jun 3, 2014

Closed:

e43869f

@gmallard
Copy link
Owner

gmallard commented Jul 6, 2016

If you are still using the stompngo package please try the current v.1.0.2 tag.

Tag information:

b1f1d96 refs/tags/v1.0.2

Document that version number in any issue reports.

Thanks for the support.

Guy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants