You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/10/08 15:37:27 UTC

[GitHub] [geode] agingade commented on a change in pull request #5605: GEODE-8584: Message transmission fails with IllegalStateException in socket i/o code

agingade commented on a change in pull request #5605:
URL: https://github.com/apache/geode/pull/5605#discussion_r501818461



##########
File path: geode-core/src/main/java/org/apache/geode/internal/tcp/Connection.java
##########
@@ -2588,17 +2592,20 @@ void writeFully(SocketChannel channel, ByteBuffer buffer, boolean forceAsync,
           }
           // fall through
         }
-        ByteBuffer wrappedBuffer = ioFilter.wrap(buffer);
-        while (wrappedBuffer.remaining() > 0) {
-          int amtWritten = 0;
-          long start = stats.startSocketWrite(true);
-          try {
-            amtWritten = channel.write(wrappedBuffer);
-          } finally {
-            stats.endSocketWrite(true, start, amtWritten, 0);
+        // synchronize on the ioFilter while using its network buffer
+        synchronized (ioFilter) {
+          ByteBuffer wrappedBuffer = ioFilter.wrap(buffer);
+          while (wrappedBuffer.remaining() > 0) {
+            int amtWritten = 0;
+            long start = stats.startSocketWrite(true);
+            try {
+              amtWritten = channel.write(wrappedBuffer);

Review comment:
       Is there anything that needs to be done, if write throws exception...Sorry I may be asking wrong question as I don't have much context here.

##########
File path: geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java
##########
@@ -396,9 +402,17 @@ public synchronized void close(SocketChannel socketChannel) {
     } catch (IOException e) {
       throw new GemFireIOException("exception closing SSL session", e);
     } finally {
-      bufferPool.releaseBuffer(TRACKED_SENDER, myNetData);
-      bufferPool.releaseBuffer(TRACKED_RECEIVER, peerAppData);
+      logger.info("NioSSLEngine releasing two buffers myNetData={}({}), peerAppData={}({})",

Review comment:
       This should be info or debug level log? just checking...




----------------------------------------------------------------
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:
users@infra.apache.org