He-Pin commented on code in PR #3273:
URL: https://github.com/apache/pekko/pull/3273#discussion_r3498260044


##########
actor/src/main/scala/org/apache/pekko/io/TcpConnection.scala:
##########
@@ -410,8 +410,15 @@ private[io] abstract class TcpConnection(val tcp: TcpExt, 
val channel: SocketCha
       (if (writePending) Set(pendingWrite.commander) else Set.empty) ++
       closedMessage.toList.flatMap(_.notificationsTo).toSet
 
-    if (channel.isOpen) // if channel is still open here, we didn't go through 
stopWith => unexpected actor termination
+    if (channel.isOpen) {
       prepareAbort()
+      // Without a ChannelRegistration there is no selector callback to close 
through.
+      if (registration.isEmpty)
+        try channel.close()
+        catch {
+          case NonFatal(e) => log.debug("Error closing SocketChannel: {}", e)

Review Comment:
   Error when closing?, and the `{}` should not be there and it should be  an 
error



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to