Buggy code:
@ ThreadSafe public final class ChannelImpl extends Channel { private static final Logger log = Logger . getLogger ( ChannelImpl . class . getName ( ) ) ; private final ClientTransportFactory transportFactory ; private final ExecutorService executor ; private final String userAgent ; private final Object lock = new Object ( ) ; private ScheduledExecutorService deadlineCancellationExecutor ; private final Channel interceptorChannel ; @ GuardedBy ( "lock" ) private Collection < ClientTransport > transports = new ArrayList < ClientTransport > ( ) ; private volatile ClientTransport activeTransport ; @ GuardedBy ( "lock" ) private boolean shutdown ; @ GuardedBy ( "lock" ) private boolean terminated ; private Runnable terminationRunnable ; private final ClientTransportProvider transportProvider = new ClientTransportProvider ( ) { @ Override public ClientTransport get ( ) { } } ; ChannelImpl ( ClientTransportFactory transportFactory , ExecutorService executor , @ Nullable String userAgent , List < ClientInterceptor > interceptors ) { } void setTerminationRunnable ( Runnable runnable ) { } public ChannelImpl shutdown ( ) { } public ChannelImpl shutdownNow ( ) { } public boolean isShutdown ( ) { } public boolean awaitTerminated ( long timeout , TimeUnit unit ) throws InterruptedException { } public boolean isTerminated ( ) { } public void ping ( final PingCallback callback , final Executor executor ) { } @ Override public < ReqT , RespT > ClientCall < ReqT , RespT > newCall ( MethodDescriptor < ReqT , RespT > method , CallOptions callOptions ) { } private ClientTransport obtainActiveTransport ( ) { } private class RealChannel extends Channel { @ Override public < ReqT , RespT > ClientCall < ReqT , RespT > newCall ( MethodDescriptor < ReqT , RespT > method , CallOptions callOptions ) { } } private class TransportListener implements ClientTransport . Listener { private final ClientTransport transport ; public TransportListener ( ClientTransport transport ) { } @ Override public void transportReady ( ) { } @ Override public void transportShutdown ( Status s ) { } @ Override public void transportTerminated ( ) { synchronized ( lock ) { if ( ( activeTransport ) == ( transport ) ) { ChannelImpl . log . warning ( "transportTerminated<seq2seq4repair_space>called<seq2seq4repair_space>without<seq2seq4repair_space>previous<seq2seq4repair_space>transportShutdown" ) ; activeTransport = null ; } <START_BUG> transportShutdown ( UNKNOWN ) ; <END_BUG> transports . remove ( transport ) ; if ( ( shutdown ) && ( transports . isEmpty ( ) ) ) { if ( terminated ) { ChannelImpl . log . warning ( "transportTerminated<seq2seq4repair_space>called<seq2seq4repair_space>after<seq2seq4repair_space>already<seq2seq4repair_space>terminated" ) ; } terminated = true ; lock . notifyAll ( ) ; if ( ( terminationRunnable ) != null ) { terminationRunnable . run ( ) ; } } } } } @ VisibleForTesting public static final Metadata . Key < Long > TIMEOUT_KEY = Key . of ( TIMEOUT , new ChannelImpl . TimeoutMarshaller ( ) ) ; @ VisibleForTesting static class TimeoutMarshaller implements Metadata . AsciiMarshaller < Long > { @ Override public String toAsciiString ( Long timeoutMicros ) { } @ Override public Long parseAsciiString ( String serialized ) { } } static final SharedResourceHolder . Resource < ScheduledExecutorService > TIMER_SERVICE = new SharedResourceHolder . Resource < ScheduledExecutorService > ( ) { @ Override public ScheduledExecutorService create ( ) { } @ Override public void close ( ScheduledExecutorService instance ) { } } ; }

Fix:
transportShutdown ( UNKNOWN . withDescription ( "transport<seq2seq4repair_space>shutdown<seq2seq4repair_space>for<seq2seq4repair_space>unknown<seq2seq4repair_space>reason" ) ) ;