protected void doCloseChannelDueToUnrecoverableError(Throwable cause) { // We should now be in the channel's event loop. Do a final check to make sure the call is still active // since it could have closed while we were waiting to run on the event loop. if (callActiveHolder.heldObject) { runnableWithTracingAndMdc( () -> logger.error("Closing StreamingChannel due to unrecoverable error. " + "channel_id={}, unrecoverable_error={}", channel.toString(), String.valueOf(cause) ), distributedTracingSpanStack, distributedTracingMdcInfo ).run(); // Mark the channel as broken so it will be closed and removed from the pool when it is returned. markChannelAsBroken(channel); // Release it back to the pool if possible/necessary so the pool can do its usual cleanup. releaseChannelBackToPoolIfCallIsActive( channel, pool, callActiveHolder, "closing StreamingChannel due to unrecoverable error: " + String.valueOf(cause), distributedTracingSpanStack, distributedTracingMdcInfo ); // No matter what the cause is we want to make sure the channel is closed. channel.close(); } else { logger.debug("The call deactivated before we could close the StreamingChannel. Therefore there's " + "nothing to do for this unrecoverable error as any necessary cleanup has already been " + "done. ignored_unrecoverable_error={}", cause.toString()); } } }
protected void doCloseChannelDueToUnrecoverableError(Throwable cause) { // We should now be in the channel's event loop. Do a final check to make sure the call is still active // since it could have closed while we were waiting to run on the event loop. if (callActiveHolder.heldObject) { runnableWithTracingAndMdc( () -> logger.error("Closing StreamingChannel due to unrecoverable error. " + "channel_id={}, unrecoverable_error={}", channel.toString(), String.valueOf(cause) ), distributedTracingSpanStack, distributedTracingMdcInfo ).run(); // Mark the channel as broken so it will be closed and removed from the pool when it is returned. markChannelAsBroken(channel); // Release it back to the pool if possible/necessary so the pool can do its usual cleanup. releaseChannelBackToPoolIfCallIsActive( channel, pool, callActiveHolder, "closing StreamingChannel due to unrecoverable error: " + String.valueOf(cause), distributedTracingSpanStack, distributedTracingMdcInfo ); // No matter what the cause is we want to make sure the channel is closed. channel.close(); } else { logger.debug("The call deactivated before we could close the StreamingChannel. Therefore there's " + "nothing to do for this unrecoverable error as any necessary cleanup has already been " + "done. ignored_unrecoverable_error={}", cause.toString()); } } }
releaseChannelBackToPoolIfCallIsActive( ch, pool, callActiveHolder, "error received in downstream pipeline: " + cause.toString(), distributedSpanStackToUse, mdcContextToUse
releaseChannelBackToPoolIfCallIsActive( ch, pool, callActiveHolder, "error received in downstream pipeline: " + cause.toString(), distributedSpanStackToUse, mdcContextToUse
releaseChannelBackToPoolIfCallIsActive(ch, pool, callActiveHolder, "last content chunk sent", distributedSpanStackToUse, mdcContextToUse);
releaseChannelBackToPoolIfCallIsActive(ch, pool, callActiveHolder, "last content chunk sent", distributedSpanStackToUse, mdcContextToUse);