ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [37/43] ignite git commit: GridServiceProcessor: guard submit in 'depExe' pool to avoid RejectedExecutionException.
Date Fri, 17 Jun 2016 12:39:06 GMT
GridServiceProcessor: guard submit in 'depExe' pool to avoid RejectedExecutionException.


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

Branch: refs/heads/ignite-3335
Commit: f260589d79833b86271f033a37404c542933bc6e
Parents: 7da0a02
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Jun 16 12:09:15 2016 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Jun 16 12:09:15 2016 +0300

----------------------------------------------------------------------
 .../service/GridServiceProcessor.java           | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f260589d/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
index 853e6bf..add90e2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/service/GridServiceProcessor.java
@@ -35,7 +35,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicReference;
 import javax.cache.Cache;
 import javax.cache.event.CacheEntryEvent;
-import javax.cache.event.CacheEntryListenerException;
 import javax.cache.event.CacheEntryUpdatedListener;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
@@ -60,7 +59,6 @@ import org.apache.ignite.internal.processors.cache.CacheIteratorConverter;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.query.CacheQuery;
 import org.apache.ignite.internal.processors.cache.query.GridCacheQueryManager;
-import org.apache.ignite.internal.processors.cache.query.continuous.CacheContinuousQueryManager;
 import org.apache.ignite.internal.processors.cache.transactions.IgniteInternalTx;
 import org.apache.ignite.internal.processors.task.GridInternal;
 import org.apache.ignite.internal.processors.timeout.GridTimeoutObject;
@@ -1312,11 +1310,19 @@ public class GridServiceProcessor extends GridProcessorAdapter {
     private class ServiceEntriesListener implements CacheEntryUpdatedListener<Object,
Object> {
         /** {@inheritDoc} */
         @Override public void onUpdated(final Iterable<CacheEntryEvent<?, ?>>
deps) {
-            depExe.submit(new BusyRunnable() {
-                @Override public void run0() {
-                    onSystemCacheUpdated(deps);
-                }
-            });
+            if (!busyLock.enterBusy())
+                return;
+
+            try {
+                depExe.submit(new BusyRunnable() {
+                    @Override public void run0() {
+                        onSystemCacheUpdated(deps);
+                    }
+                });
+            }
+            finally {
+                busyLock.leaveBusy();
+            }
         }
     }
 


Mime
View raw message