Skip to content

Commit

Permalink
Debug-log when RoundRobinLoadBalancer closes connections to inactiv…
Browse files Browse the repository at this point in the history
…e addresses (#1351)

Motivation:

When RRLB receives an inactive event from `ServiceDiscoverer`, it initiates
graceful closure of all connections to the host that became inactive. Give
some visibility to this logic.

Modifications:

- Add `DEBUG` log statement when RRLB closes connections to inactive host;

Result:

Users can debug when RRLB initiates connection closure.
  • Loading branch information
idelpivnitskiy authored Feb 4, 2021
1 parent af2db97 commit 58baa0a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ private static class Host<Addr, C extends ListenableAsyncCloseable> implements A
void markInactive() {
@SuppressWarnings("unchecked")
final List<C> toRemove = connectionsUpdater.getAndSet(this, CLOSED_LIST);
LOGGER.debug("Closing {} connection(s) gracefully to inactive address: {}", toRemove.size(), address);
for (C conn : toRemove) {
conn.closeAsyncGracefully().subscribe();
}
Expand Down

0 comments on commit 58baa0a

Please sign in to comment.