Skip to content

Commit

Permalink
feat: more logging for ChannelPool shutdown (#2070)
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbernstein2 committed Oct 6, 2023
1 parent f2b8280 commit b8365c2
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -152,6 +152,8 @@ Channel getChannel(int affinity) {
/** {@inheritDoc} */
@Override
public ManagedChannel shutdown() {
LOG.fine("Initiating graceful shutdown due to explicit request");

List<Entry> localEntries = entries.get();
for (Entry entry : localEntries) {
entry.channel.shutdown();
Expand Down Expand Up @@ -191,6 +193,8 @@ public boolean isTerminated() {
/** {@inheritDoc} */
@Override
public ManagedChannel shutdownNow() {
LOG.fine("Initiating immediate shutdown due to explicit request");

List<Entry> localEntries = entries.get();
for (Entry entry : localEntries) {
entry.channel.shutdownNow();
Expand Down Expand Up @@ -356,6 +360,7 @@ void refresh() {
// - then thread2 will shut down channel that thread1 will put back into circulation (after it
// replaces the list)
synchronized (entryWriteLock) {
LOG.fine("Refreshing all channels");
ArrayList<Entry> newEntries = new ArrayList<>(entries.get());

for (int i = 0; i < newEntries.size(); i++) {
Expand Down

0 comments on commit b8365c2

Please sign in to comment.