functioner commented on a change in pull request #11504:
URL: https://github.com/apache/kafka/pull/11504#discussion_r753548985



##########
File path: core/src/main/scala/kafka/network/SocketServer.scala
##########
@@ -734,6 +734,10 @@ private[kafka] class Acceptor(val endPoint: EndPoint,
         val endThrottleTimeMs = e.startThrottleTimeMs + e.throttleTimeMs
         throttledSockets += DelayedCloseSocket(socketChannel, 
endThrottleTimeMs)
         None
+      case e: IOException =>
+        info(s"Encounter IOException", e)
+        closeSocket(socketChannel)

Review comment:
       There are multiple classes defined in 
`core/src/main/scala/kafka/network/SocketServer.scala`. The `accept` method 
belongs to `Acceptor`, rather than `SocketServer`, so we can't override 
`accept` the way you show. We need to override `accept` in `Acceptor`, and then 
use this `Acceptor` when the `SocketServer` is initialized. Therefore, we need 
to first override `createAcceptor` in `SocketServer`, and then override 
`accept` in `Acceptor`. In addition, we need to change `createAcceptor` & 
`accept` from private to protected; we also need to change some fields from 
private to protected.
   
   I've pushed a new commit implementing the test using this idea.




-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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


Reply via email to