Skip to content

Commit b8365c2

Browse files
feat: more logging for ChannelPool shutdown (#2070)
1 parent f2b8280 commit b8365c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ChannelPool.java

+5
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ Channel getChannel(int affinity) {
152152
/** {@inheritDoc} */
153153
@Override
154154
public ManagedChannel shutdown() {
155+
LOG.fine("Initiating graceful shutdown due to explicit request");
156+
155157
List<Entry> localEntries = entries.get();
156158
for (Entry entry : localEntries) {
157159
entry.channel.shutdown();
@@ -191,6 +193,8 @@ public boolean isTerminated() {
191193
/** {@inheritDoc} */
192194
@Override
193195
public ManagedChannel shutdownNow() {
196+
LOG.fine("Initiating immediate shutdown due to explicit request");
197+
194198
List<Entry> localEntries = entries.get();
195199
for (Entry entry : localEntries) {
196200
entry.channel.shutdownNow();
@@ -356,6 +360,7 @@ void refresh() {
356360
// - then thread2 will shut down channel that thread1 will put back into circulation (after it
357361
// replaces the list)
358362
synchronized (entryWriteLock) {
363+
LOG.fine("Refreshing all channels");
359364
ArrayList<Entry> newEntries = new ArrayList<>(entries.get());
360365

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

0 commit comments

Comments
 (0)