-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
connect dispatcher again on reset cursor complete #250
Conversation
@merlimat @saandrews we have to add it to the patch as regression tests are failing. |
0ee7e7f
to
149ac5f
Compare
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.
Just a few naming comments. If it's urgent just go ahead with current names
* disconnect all consumers and mark dispatcher closed to stop new incoming requests | ||
* | ||
* @return | ||
*/ | ||
CompletableFuture<Void> disconnect(); |
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.
Perhaps we should also rename this method to something like disconnectAllConsumers()
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.
sure, updated name as : disconnectAllConsumers()
/** | ||
* mark dispatcher open to serve new incoming requests | ||
*/ | ||
void connect(); |
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.
Naming sound a bit strange to me, since the the dispatcher itself does not "connect" to anything :)
What about reset()
or something else?
@@ -561,6 +560,11 @@ public double getExpiredMessageRate() { | |||
return expiryMonitor.getMessageExpiryRate(); | |||
} | |||
|
|||
private void unfenceSubscriptionAndConnectDispatcher() { |
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.
naming is a bit confusing, what about resetState()
or clearFencingState()
?
@merlimat updated changes. |
@merlimat before merging this PR: was thinking another change:
|
Still I'm not clear what "disconnecting dispatcher" means :) . We can disconnect the consumer by either closing the TCP connection or anyway reject everything from it, but what does that mean for the dispatcher. Isn't then |
3573054
to
943f74f
Compare
Yes, I tried to explain as per old api |
👍 |
for (String subs : subList) { | ||
log.info("got sub " + subs); | ||
} | ||
consumer.close(); |
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.
Consumer close is not needed here, right?
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.
that's correct. fixed it.
b36de9f
to
fb87bc8
Compare
fb87bc8
to
a32b7ae
Compare
@merlimat updated discussed change. Can you please review it. |
👍 |
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.
Looks good
Motivation
Reset-cursor disconnects consumers and closes Dispatcher that will not allow message-dispatching (because
closeFuture!=null
) even after reset-cursor completes.Modifications
Reset cursor:
Result
Reset-cursor will not block message-dispatching for newly added consumers.