Skip to content

Commit

Permalink
unconditionally check currentSubscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
idelpivnitskiy committed Jul 13, 2024
1 parent d48d8f5 commit 3cf255f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private void sequentialOnNext(Collection<? extends ServiceDiscovererEvent<Resolv
// (https://github.com/reactive-streams/reactive-streams-jvm?tab=readme-ov-file#1.8) new events will
// stop eventually but not guaranteed to stop immediately after cancellation or could race with cancel.
// Therefore, we should check that this is the current Subscriber before processing new events.
if (healthCheckConfig != null && currentSubscriber != this) {
if (currentSubscriber != this) {
LOGGER.debug("{}: received new events after cancelling previous subscription, discarding: {}",
DefaultLoadBalancer.this, events);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void onNext(@Nullable final Collection<? extends ServiceDiscovererEvent<R
// (https://github.com/reactive-streams/reactive-streams-jvm?tab=readme-ov-file#1.8) new events will
// stop eventually but not guaranteed to stop immediately after cancellation or could race with cancel.
// Therefore, we should check that this is the current Subscriber before processing new events.
if (healthCheckConfig != null && currentSubscriber != this) {
if (currentSubscriber != this) {
LOGGER.debug("{}: received new events after cancelling previous subscription, discarding: {}",
RoundRobinLoadBalancer.this, events);
return;
Expand Down

0 comments on commit 3cf255f

Please sign in to comment.