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

Implementing request timeout support to ensure when things like network stall the socket or the ZooKeeper server instance freezes close and reconnect is attempted #16

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

robskillington
Copy link

No description provided.

Rob Skillington added 2 commits February 20, 2014 23:48
…ike network stall the socket or the ZooKeeper server instance freezes
@robskillington
Copy link
Author

@alexguan hey - the lack of request timeout is causing several issues using the library on our team, our callbacks never get called with failure events until a very long time after a connection stalls or process freezes.

I have tested this fix extensively with things like stalling the network and freezing the server instance and it seems to be very robust for our use case, thought it would be good to see if you would like to include in the core library.

@alexguan
Copy link
Owner

I will take a look at this this weekend.

@robskillington
Copy link
Author

Thanks mate!

@robskillington
Copy link
Author

@alexguan any thoughts?

@alexguan
Copy link
Owner

Thanks for the PR, I'm investigating the current Java implementation to see if there is any existing solutions to this timeout issue.

@robskillington
Copy link
Author

@alexguan any results from your investigation? I had to ship with a private build of this unfortunately and would love to have it in the mainline. I actually updated this PR to default to no requestTimeout (use boolean false) so this PR will not affect existing users out there. I'd love to have a 1:1 conversation some time about your thoughts on this, over IM or voice - its a feature I think that this client really desperately needs for production use.

@alexguan
Copy link
Owner

Sorry Rob, traveling in Japan now, I will try to have a solution this week.

@robskillington
Copy link
Author

@alexguan hope Japan was fun! Any thoughts/word?

…connecting under heavy network IO load - should keep trying to reconnect
@robskillington
Copy link
Author

I updated the expiry disconnect behavior just now by the way to retry on session expiry which can happen when reconnecting under heavy network IO load - should keep trying to reconnect.

We have had issues in our perf testing where this would occur and the client would be dead in the water and stop trying to reconnect.

@robskillington
Copy link
Author

@alexguan care to weigh in?

@@ -260,7 +278,7 @@ ConnectionManager.prototype.onSocketClosed = function (hasError) {
break;
case STATES.SESSION_EXPIRED:
errorCode = Exception.SESSION_EXPIRED;
retry = false;
retry = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The correct way to handle session expire is to create a new session and should handle by the client instead of the library.

Could you explain why you want to retry here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, considering the retry logic I had assumed that the client was intended for indefinite retry/long lived persistent connections.

No problems, can revert this change and then create a new client class if we want to reconnect with a new session?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main point is that the session expire should not be handled by the client library but application logic, since only application knows what's the correct action for a session expire event. You don't want to hide it from the client.

@robskillington
Copy link
Author

Sure thing. I'll revert this tonight, just out at dinner atm :)

@mosnicholas
Copy link

This is stopping me as well, @alexguan can this PR be merged?

Thanks

@estliberitas
Copy link

@alexguan +1 to @mosnicholas since druid-query depends on your module.

P.S.: are you still interested and have time for this project?

@alexguan
Copy link
Owner

alexguan commented Dec 4, 2014

I'm investigating the current Java client implementation to make sure the connection timeout is handled in the same manner.

@estliberitas
Copy link

So? 😉 @alexguan

@estliberitas
Copy link

@alexguan ?

@schulzetenberg
Copy link

+1

@samypr100
Copy link

samypr100 commented Aug 17, 2016

@alexguan
When is this going to be added???

@estliberitas
Copy link

@alexguan no, never? 😛

@ecasilla
Copy link

ecasilla commented Apr 7, 2017

It seems like this project is no longer maintained

@perseus086
Copy link

Please merge the PR

@montaro
Copy link

montaro commented Dec 13, 2017

Bump

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

Successfully merging this pull request may close these issues.

9 participants