sergey-chugunov-1985 commented on a change in pull request #8824:
URL: https://github.com/apache/ignite/pull/8824#discussion_r594891776



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
##########
@@ -4217,6 +4217,32 @@ public static void close(@Nullable AutoCloseable rsrc, 
@Nullable IgniteLogger lo
         }
     }
 
+    /**
+     * Closes given socket logging possible checked exception.
+     *
+     * @param sock Socket to close. If it's {@code null} - it's no-op.
+     * @param log Logger to log possible checked exception with (optional).
+     */
+    public static void close(@Nullable Socket sock, @Nullable IgniteLogger 
log) {
+        if (sock != null) {
+            try {
+                //avoid tls 1.3 incompatibility 
https://bugs.openjdk.java.net/browse/JDK-8208526
+                sock.shutdownOutput();
+                sock.shutdownInput();
+            }
+            catch (Exception e) {
+                warn(log, "Failed to close socket: " + e.getMessage(), e);

Review comment:
       I suggest to use different log message here, like `Failed to shutdown 
socket: `, it will make logs analysis a bit easier.




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


Reply via email to