curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [2/2] curator git commit: Don't queue background operation if the client is closed
Date Mon, 28 Dec 2015 15:12:14 GMT
Don't queue background operation if the client is closed


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

Branch: refs/heads/CURATOR-209
Commit: 8dff2d7cf69f21fdc42e31fb33feed990915fcc7
Parents: 9b68e19
Author: randgalt <randgalt@apache.org>
Authored: Mon Dec 28 10:11:55 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Mon Dec 28 10:11:55 2015 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/imps/CuratorFrameworkImpl.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/8dff2d7c/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
index 38ce166..9c017d0 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
@@ -533,7 +533,10 @@ public class CuratorFrameworkImpl implements CuratorFramework
 
     <DATA_TYPE> void queueOperation(OperationAndData<DATA_TYPE> operationAndData)
     {
-        backgroundOperations.offer(operationAndData);
+        if ( getState() == CuratorFrameworkState.STARTED )
+        {
+            backgroundOperations.offer(operationAndData);
+        }
     }
 
     void logError(String reason, final Throwable e)


Mime
View raw message