-
Couldn't load subscription status.
- Fork 142
Modify PackateQueue to let auth request go first and other request go last #52
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
base: master
Are you sure you want to change the base?
Conversation
|
Anyone to review this? |
|
I will take a look this weekend |
|
So how's the result? |
|
In what scenario you will call getData before the connection is established? |
|
@alexguan Sorry but I forgot the reason because it takes a long time. Maybe reconnecting? |
|
This PR looks good. This is a much-needed PR for situations when there are multiple watchers receiving data and suddenly authentication fails due to any reason. To reinitiate the authentication zookeeper initiates another auth request. Since the auth request is not prioritized in the queue, the other requests initiated by the watchers fail until the authentication request passes. |
|
Sorry for the long delay, can someone bump up the version and changelog like this PR and I will merge it. |
|
@alexguan Are we supposed to create a new PR for the version bump? |
See code below:
getData's command will be at the first position of the queue array and auth command will be the second.Because
getDatawill push to queue immediately butaddAuthInfowill push after connected.So I modify
PacketQueue.prototype.pushto let auth request go the first.