ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [29/50] [abbrv] ignite git commit: Fixed ByteBufferNioClientWorker/ssl write according to recent changes in nio session.
Date Mon, 10 Oct 2016 12:13:25 GMT
Fixed ByteBufferNioClientWorker/ssl write according to recent changes in nio session.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/a8ef28ef
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/a8ef28ef
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/a8ef28ef

Branch: refs/heads/ignite-gg-8-io2-selNow
Commit: a8ef28ef020ef1bfc29e28aae4dd3486f0d740c8
Parents: 4ba2deb
Author: sboikov <sboikov@gridgain.com>
Authored: Fri Sep 30 13:27:53 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Fri Sep 30 13:27:53 2016 +0300

----------------------------------------------------------------------
 .../ignite/internal/util/nio/GridNioServer.java | 22 ++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/a8ef28ef/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
index ce1f59c..1c4599c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java
@@ -844,7 +844,16 @@ public class GridNioServer<T> {
                     req = (NioOperationFuture<?>)ses.pollFuture();
 
                     if (req == null) {
-                        key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
+                        if (ses.procWrite.get()) {
+                            boolean set = ses.procWrite.compareAndSet(true, false);
+
+                            assert set;
+
+                            if (ses.writeQueue().isEmpty())
+                                key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
+                            else
+                                ses.procWrite.set(true);
+                        }
 
                         break;
                     }
@@ -1043,7 +1052,16 @@ public class GridNioServer<T> {
                         req = (NioOperationFuture<?>)ses.pollFuture();
 
                         if (req == null && buf.position() == 0) {
-                            key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
+                            if (ses.procWrite.get()) {
+                                boolean set = ses.procWrite.compareAndSet(true, false);
+
+                                assert set;
+
+                                if (ses.writeQueue().isEmpty())
+                                    key.interestOps(key.interestOps() & (~SelectionKey.OP_WRITE));
+                                else
+                                    ses.procWrite.set(true);
+                            }
 
                             break;
                         }


Mime
View raw message