dajac commented on a change in pull request #10024:
URL: https://github.com/apache/kafka/pull/10024#discussion_r580091790



##########
File path: core/src/main/scala/kafka/common/InterBrokerSendThread.scala
##########
@@ -78,6 +77,9 @@ abstract class InterBrokerSendThread(
       failExpiredRequests(now)
       unsentRequests.clean()
     } catch {
+      case _: DisconnectException if isShutdownInitiated =>
+        // DisconnectException is caused by NetworkClient#ensureActive
+        // this thread is closing so this error is acceptable

Review comment:
       @chia7712 I understand your point. I was thinking that the exception is 
actually expected when `networkClient.initiateClose()` is called so it makes 
sense to rely on the `networkClient` to decide if it is expected or not. Today, 
this is tight to the thread being shutdown as you pointed out. If we would 
change this in the future, it will be really easy to mis changing this 
condition and this could led to a subtile bug like this one. I don't feel 
strong for either approaches so I leave it up to you.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to