ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject [42/50] incubator-ignite git commit: ignite-774: rethrow all errors
Date Fri, 24 Apr 2015 01:15:15 GMT
ignite-774: rethrow all errors


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

Branch: refs/heads/ignite-gg-9830
Commit: bc89338ffcd54d405db82e352f08aa648da37292
Parents: 75425c6
Author: Artem Shutak <ashutak@gridgain.com>
Authored: Thu Apr 23 15:13:16 2015 +0300
Committer: Artem Shutak <ashutak@gridgain.com>
Committed: Thu Apr 23 15:13:16 2015 +0300

----------------------------------------------------------------------
 .../aop/aspectj/GridifyAspectJAspect.java       |  2 +-
 .../aspectj/GridifySetToSetAspectJAspect.java   |  2 +-
 .../aspectj/GridifySetToValueAspectJAspect.java |  2 +-
 .../aop/spring/GridifySetToSetSpringAspect.java |  2 +-
 .../spring/GridifySetToValueSpringAspect.java   |  2 +-
 .../gridify/aop/spring/GridifySpringAspect.java |  2 +-
 .../apache/ignite/cache/CachingProvider.java    |  3 +++
 .../ignite/events/CacheQueryExecutedEvent.java  |  3 ++-
 .../ignite/events/CacheQueryReadEvent.java      |  3 ++-
 .../apache/ignite/internal/IgniteKernal.java    | 15 +++++++++--
 .../org/apache/ignite/internal/IgnitionEx.java  |  6 +++++
 .../deployment/GridDeploymentClassLoader.java   |  2 +-
 .../discovery/GridDiscoveryManager.java         |  3 +++
 .../eventstorage/GridEventStorageManager.java   |  6 +++++
 .../cache/CacheStoreBalancingWrapper.java       |  6 +++++
 .../processors/cache/GridCacheIoManager.java    |  6 +++++
 .../GridDistributedTxRemoteAdapter.java         |  3 +++
 .../cache/distributed/dht/GridDhtTxLocal.java   |  3 +++
 .../GridDhtPartitionsExchangeFuture.java        |  3 +++
 .../near/GridNearTxFinishFuture.java            |  3 +++
 .../query/GridCacheDistributedQueryManager.java |  3 +++
 .../cache/query/GridCacheLocalQueryFuture.java  |  3 +++
 .../query/GridCacheQueryFutureAdapter.java      |  3 +++
 .../cache/query/GridCacheQueryManager.java      |  9 +++++++
 .../jdbc/GridCacheQueryJdbcMetadataTask.java    |  3 +++
 .../cache/transactions/IgniteTxAdapter.java     |  7 +++--
 .../cache/transactions/IgniteTxHandler.java     | 27 ++++++++++++++++++--
 .../transactions/IgniteTxLocalAdapter.java      | 12 +++++++++
 .../closure/GridClosureProcessor.java           | 16 ++++++++++--
 .../processors/igfs/IgfsFileWorkerBatch.java    |  3 +++
 .../internal/processors/igfs/IgfsThread.java    |  8 +++++-
 .../internal/processors/job/GridJobWorker.java  |  9 +++++++
 .../processors/query/GridQueryProcessor.java    |  3 +++
 .../processors/rest/GridRestProcessor.java      |  3 +++
 .../service/GridServiceProcessor.java           |  9 +++++++
 .../processors/task/GridTaskWorker.java         | 12 +++++++++
 .../timeout/GridTimeoutProcessor.java           |  3 +++
 .../ignite/internal/util/IgniteUtils.java       |  2 +-
 .../util/ipc/loopback/IpcServerTcpEndpoint.java |  2 +-
 .../shmem/IpcSharedMemoryServerEndpoint.java    |  2 +-
 .../ignite/internal/util/lang/GridFunc.java     | 12 ++++-----
 .../ignite/internal/util/nio/GridNioServer.java |  6 +++++
 .../apache/ignite/internal/util/typedef/X.java  |  2 +-
 .../ignite/internal/util/worker/GridWorker.java |  3 +++
 .../visor/misc/VisorResolveHostNameTask.java    |  2 +-
 .../visor/node/VisorNodeDataCollectorJob.java   |  9 +++++++
 .../ignite/messaging/MessagingListenActor.java  |  3 +++
 .../org/apache/ignite/spi/IgniteSpiThread.java  |  3 +++
 .../spi/discovery/tcp/TcpDiscoverySpi.java      |  3 +++
 .../startup/cmdline/CommandLineStartup.java     |  5 +++-
 .../startup/cmdline/CommandLineTransformer.java |  3 +++
 .../processors/hadoop/HadoopDefaultJobInfo.java |  3 +++
 .../processors/hadoop/igfs/HadoopIgfsIpcIo.java |  3 +++
 .../hadoop/jobtracker/HadoopJobTracker.java     |  5 +++-
 .../hadoop/taskexecutor/HadoopRunnableTask.java |  3 +++
 .../external/HadoopExternalTaskExecutor.java    |  3 +++
 .../processors/hadoop/v2/HadoopV2Job.java       | 11 +++++++-
 .../hadoop/v2/HadoopV2TaskContext.java          |  9 +++++++
 .../query/h2/twostep/GridMapQueryExecutor.java  |  3 +++
 .../http/jetty/GridJettyRestHandler.java        |  3 +++
 .../ignite/schema/ui/SchemaImportApp.java       |  8 +++---
 .../uri/GridUriDeploymentClassLoader.java       |  4 +--
 62 files changed, 284 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifyAspectJAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifyAspectJAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifyAspectJAspect.java
index 1cccc1e..f13b64c 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifyAspectJAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifyAspectJAspect.java
@@ -102,7 +102,7 @@ public class GridifyAspectJAspect {
             // If task name was specified.
             return ignite.compute().withTimeout(ann.timeout()).execute(ann.taskName(), arg);
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToSetAspectJAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToSetAspectJAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToSetAspectJAspect.java
index 6d5d05f..acd318b 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToSetAspectJAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToSetAspectJAspect.java
@@ -113,7 +113,7 @@ public class GridifySetToSetAspectJAspect extends GridifySetToSetAbstractAspect
             return execute(ignite.compute(), joinPnt.getSignature().getDeclaringType(), arg, nodeFilter,
                 ann.threshold(), ann.splitSize(), ann.timeout());
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToValueAspectJAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToValueAspectJAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToValueAspectJAspect.java
index 46d4c56..ae39ceb 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToValueAspectJAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/aspectj/GridifySetToValueAspectJAspect.java
@@ -113,7 +113,7 @@ public class GridifySetToValueAspectJAspect extends GridifySetToValueAbstractAsp
             return execute(mtd, ignite.compute(), joinPnt.getSignature().getDeclaringType(), arg, nodeFilter,
                 ann.threshold(), ann.splitSize(), ann.timeout());
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : ((MethodSignature) joinPnt.getSignature()).getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToSetSpringAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToSetSpringAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToSetSpringAspect.java
index 102b60c..b7499af 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToSetSpringAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToSetSpringAspect.java
@@ -108,7 +108,7 @@ public class GridifySetToSetSpringAspect extends GridifySetToSetAbstractAspect i
             return execute(ignite.compute(), invoc.getMethod().getDeclaringClass(), arg, nodeFilter,
                 ann.threshold(), ann.splitSize(), ann.timeout());
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : invoc.getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToValueSpringAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToValueSpringAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToValueSpringAspect.java
index cf6557c..af4bee6 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToValueSpringAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySetToValueSpringAspect.java
@@ -108,7 +108,7 @@ public class GridifySetToValueSpringAspect extends GridifySetToValueAbstractAspe
             return execute(mtd, ignite.compute(), invoc.getMethod().getDeclaringClass(), arg, nodeFilter,
                 ann.threshold(), ann.splitSize(), ann.timeout());
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : invoc.getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySpringAspect.java
----------------------------------------------------------------------
diff --git a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySpringAspect.java b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySpringAspect.java
index a11e2f1..a7984c5 100644
--- a/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySpringAspect.java
+++ b/modules/aop/src/main/java/org/apache/ignite/compute/gridify/aop/spring/GridifySpringAspect.java
@@ -96,7 +96,7 @@ public class GridifySpringAspect implements MethodInterceptor {
             // If task name was specified.
             return ignite.compute().withTimeout(ann.timeout()).execute(ann.taskName(), arg);
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             for (Class<?> ex : invoc.getMethod().getExceptionTypes()) {
                 // Descend all levels down.
                 Throwable cause = e.getCause();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/cache/CachingProvider.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/cache/CachingProvider.java b/modules/core/src/main/java/org/apache/ignite/cache/CachingProvider.java
index 9782bbf..47d892f 100644
--- a/modules/core/src/main/java/org/apache/ignite/cache/CachingProvider.java
+++ b/modules/core/src/main/java/org/apache/ignite/cache/CachingProvider.java
@@ -113,6 +113,9 @@ public class CachingProvider implements javax.cache.spi.CachingProvider {
 
                 fut.onDone(e);
 
+                if (e instanceof Error)
+                    throw (Error)e;
+
                 throw CU.convertToCacheException(U.cast(e));
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
index 22892bf..0cc47f1 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryExecutedEvent.java
@@ -138,7 +138,8 @@ public class CacheQueryExecutedEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
+     * @return Query type. Can be {@code "SQL"}, {@code "SQL_FIELDS"}, {@code "FULL_TEXT"}, {@code "SCAN"}, 
+     * {@code "CONTINUOUS"} or {@code "SPI"}.
      */
     public String queryType() {
         return qryType;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
index 78acdc1..e1a1f4d 100644
--- a/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
+++ b/modules/core/src/main/java/org/apache/ignite/events/CacheQueryReadEvent.java
@@ -164,7 +164,8 @@ public class CacheQueryReadEvent<K, V> extends EventAdapter {
     /**
      * Gets query type.
      *
-     * @return Query type. Can be {@code "SQL"}, {@code "TEXT"}, {@code "SCAN"} or {@code "SPI"}.
+     * @return Query type. Can be {@code "SQL"}, {@code "SQL_FIELDS"}, {@code "FULL_TEXT"}, {@code "SCAN"},
+     * {@code "CONTINUOUS"} or {@code "SPI"}.
      */
     public String queryType() {
         return qryType;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
index 7694835..d9d0e3d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgniteKernal.java
@@ -512,6 +512,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
         catch (Throwable e) {
             U.error(log, "Failed to notify lifecycle bean (safely ignored) [evt=" + evt +
                 ", gridName=" + gridName + ']', e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
     }
 
@@ -822,7 +825,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
 
             stop(true);
 
-            if (e instanceof IgniteCheckedException)
+            if (e instanceof Error)
+                throw e;
+            else if (e instanceof IgniteCheckedException)
                 throw (IgniteCheckedException)e;
             else
                 throw new IgniteCheckedException(e);
@@ -1624,7 +1629,7 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
 
                 return "Scala ver. " + props.getProperty("version.number", "<unknown>");
             }
-            catch (Throwable ignore) {
+            catch (Exception ignore) {
                 return "Scala ver. <unknown>";
             }
         }
@@ -1703,6 +1708,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
                     errOnStop = true;
 
                     U.error(log, "Failed to pre-stop processor: " + comp, e);
+
+                    if (e instanceof Error)
+                        throw e;
                 }
             }
 
@@ -1787,6 +1795,9 @@ public class IgniteKernal implements IgniteEx, IgniteMXBean, Externalizable {
                     errOnStop = true;
 
                     U.error(log, "Failed to stop component (ignoring): " + comp, e);
+
+                    if (e instanceof Error)
+                        throw (Error)e;
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
index 56ec3ae..cde8316 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/IgnitionEx.java
@@ -1465,6 +1465,9 @@ public class IgnitionEx {
             catch (Throwable e) {
                 unregisterFactoryMBean();
 
+                if (e instanceof Error)
+                    throw e;
+
                 throw new IgniteCheckedException("Unexpected exception when starting grid.", e);
             }
             finally {
@@ -1981,6 +1984,9 @@ public class IgnitionEx {
             }
             catch (Throwable e) {
                 U.error(log, "Failed to properly stop grid instance due to undeclared exception.", e);
+
+                if (e instanceof Error)
+                    throw e;
             }
             finally {
                 state = grid0.context().segmented() ? STOPPED_ON_SEGMENTATION : STOPPED;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentClassLoader.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentClassLoader.java
index eddf0a2..168216c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentClassLoader.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/deployment/GridDeploymentClassLoader.java
@@ -435,7 +435,7 @@ class GridDeploymentClassLoader extends ClassLoader implements GridDeploymentInf
         }
         // Catch Throwable to secure against any errors resulted from
         // corrupted class definitions or other user errors.
-        catch (Throwable e) {
+        catch (Exception e) {
             throw new ClassNotFoundException("Failed to load class due to unexpected error: " + name, e);
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
index f6be4ed..0950774 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/discovery/GridDiscoveryManager.java
@@ -1640,6 +1640,9 @@ public class GridDiscoveryManager extends GridManagerAdapter<DiscoverySpi> {
                 }
                 catch (Throwable t) {
                     U.error(log, "Unexpected exception in discovery worker thread (ignored).", t);
+
+                    if (t instanceof Error)
+                        throw (Error)t;
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 3e41a6a..6ebe480 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -740,6 +740,9 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
                 }
                 catch (Throwable e) {
                     U.error(log, "Unexpected exception in listener notification for event: " + evt, e);
+
+                    if (e instanceof Error)
+                        throw (Error)e;
                 }
             }
         }
@@ -1077,6 +1080,9 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
                     evts = Collections.emptyList();
 
                     ex = e;
+
+                    if (e instanceof Error)
+                        throw (Error)e;
                 }
 
                 // Response message.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStoreBalancingWrapper.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStoreBalancingWrapper.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStoreBalancingWrapper.java
index 8020005..7bbf08b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStoreBalancingWrapper.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheStoreBalancingWrapper.java
@@ -98,6 +98,9 @@ public class CacheStoreBalancingWrapper<K, V> implements CacheStore<K, V> {
         catch (Throwable e) {
             fut.onError(key, e);
 
+            if (e instanceof Error)
+                throw e;
+
             throw e;
         }
     }
@@ -173,6 +176,9 @@ public class CacheStoreBalancingWrapper<K, V> implements CacheStore<K, V> {
             catch (Throwable e) {
                 span.onError(needLoad, e);
 
+                if (e instanceof Error)
+                    throw e;
+
                 throw e;
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
index 6fefdfd..b8668e6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheIoManager.java
@@ -289,6 +289,9 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
                     "[senderId=" + nodeId + ", err=" + X.cause(e, ClassNotFoundException.class).getMessage() + ']');
             else
                 U.error(log, "Failed to process message [senderId=" + nodeId + ']', e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
         finally {
             if (depEnabled)
@@ -326,6 +329,9 @@ public class GridCacheIoManager extends GridCacheSharedManagerAdapter {
         }
         catch (Throwable e) {
             U.error(log, "Failed processing message [senderId=" + nodeId + ", msg=" + msg + ']', e);
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             // Reset thread local context.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index 5fdc1e4..5c75390 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -659,6 +659,9 @@ public class GridDistributedTxRemoteAdapter extends IgniteTxAdapter
                             // as there is no way to rollback at this point.
                             err = new IgniteTxHeuristicCheckedException("Commit produced a runtime exception " +
                                 "(all transaction entries will be invalidated): " + CU.txString(this), ex);
+
+                            if (ex instanceof Error)
+                                throw (Error)ex;
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
index f3266df..aff15d9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/GridDhtTxLocal.java
@@ -673,6 +673,9 @@ public class GridDhtTxLocal extends GridDhtTxLocalAdapter implements GridCacheMa
             catch (Throwable ex) {
                 U.error(log, "Failed to send finish response to node (transaction was " +
                     (commit ? "committed" : "rolledback") + ") [node=" + nearNodeId + ", res=" + res + ']', ex);
+
+                if (ex instanceof Error)
+                    throw (Error)ex;
             }
         }
         else {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
index 6633b5c..45d332c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java
@@ -631,6 +631,9 @@ public class GridDhtPartitionsExchangeFuture extends GridFutureAdapter<AffinityT
 
                 onDone(e);
 
+                if (e instanceof Error)
+                    throw (Error)e;
+
                 return;
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
index 3b2418e..3052810 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/near/GridNearTxFinishFuture.java
@@ -231,6 +231,9 @@ public final class GridNearTxFinishFuture<K, V> extends GridCompoundIdentityFutu
                         }
                         catch (Throwable t) {
                             U.error(log, "Failed to invalidate entry.", t);
+
+                            if (t instanceof Error)
+                                throw (Error)t;
                         }
                     }
                 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
index 99c771f..a579aab 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheDistributedQueryManager.java
@@ -191,6 +191,9 @@ public class GridCacheDistributedQueryManager<K, V> extends GridCacheQueryManage
                         U.error(log(), "Failed to run query.", e);
 
                         sendQueryResponse(sndId, new GridCacheQueryResponse(cctx.cacheId(), req.id(), e.getCause()), 0);
+
+                        if (e instanceof Error)
+                            throw (Error)e;
                     }
                     finally {
                         threads.remove(req.id());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheLocalQueryFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheLocalQueryFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheLocalQueryFuture.java
index 8039617..66db0f7 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheLocalQueryFuture.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheLocalQueryFuture.java
@@ -91,6 +91,9 @@ public class GridCacheLocalQueryFuture<K, V, R> extends GridCacheQueryFutureAdap
             }
             catch (Throwable e) {
                 onDone(e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
index 85f7326..a8bace0 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryFutureAdapter.java
@@ -405,6 +405,9 @@ public abstract class GridCacheQueryFutureAdapter<K, V, R> extends GridFutureAda
         }
         catch (Throwable e) {
             onPageError(nodeId, e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
index 16063af..1eb29dc 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java
@@ -1187,6 +1187,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                 U.error(log, "Failed to run fields query [qry=" + qryInfo + ", node=" + cctx.nodeId() + "]", e);
 
                 onFieldsPageReady(qryInfo.local(), qryInfo, null, null, null, true, e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
             finally {
                 if (rmvRes)
@@ -1439,6 +1442,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
                 U.error(log, "Failed to run query [qry=" + qryInfo + ", node=" + cctx.nodeId() + "]", e);
 
                 onPageReady(loc, qryInfo, null, true, e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
             finally {
                 if (rmvIter)
@@ -1530,6 +1536,9 @@ public abstract class GridCacheQueryManager<K, V> extends GridCacheManagerAdapte
             }
             catch (Throwable e) {
                 fut.onDone(e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
index 495f887..6111acd 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/jdbc/GridCacheQueryJdbcMetadataTask.java
@@ -156,6 +156,9 @@ public class GridCacheQueryJdbcMetadataTask extends ComputeTaskAdapter<String, b
                 catch (IgniteCheckedException e) {
                     throw new IgniteException(e);
                 }
+
+                if (t instanceof Error)
+                    throw (Error)t;
             }
 
             byte[] packet = new byte[data.length + 1];

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
index bc09f9e..0e38c43 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxAdapter.java
@@ -378,8 +378,8 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
      * @return Flag indicating whether near cache should be updated.
      */
     protected boolean updateNearCache(
-        GridCacheContext<?, ?> cacheCtx, 
-        KeyCacheObject key, 
+        GridCacheContext<?, ?> cacheCtx,
+        KeyCacheObject key,
         AffinityTopologyVersion topVer
     ) {
         return false;
@@ -472,6 +472,9 @@ public abstract class IgniteTxAdapter extends GridMetadataAwareAdapter
             catch (Throwable t) {
                 U.error(log, "Failed to invalidate transaction entries while reverting a commit.", t);
 
+                if (t instanceof Error)
+                    throw (Error)t;
+
                 break;
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
index 8e47105..affe168 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxHandler.java
@@ -522,6 +522,9 @@ public class IgniteTxHandler {
                 else
                     U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", " +
                         "res=" + res + ']', e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
 
             return null;
@@ -623,6 +626,9 @@ public class IgniteTxHandler {
                         else
                             U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", " +
                                 "res=" + res + ']', e);
+
+                        if (e instanceof Error)
+                            throw (Error)e;
                     }
 
                     return null;
@@ -632,16 +638,21 @@ public class IgniteTxHandler {
         catch (Throwable e) {
             U.error(log, "Failed completing transaction [commit=" + req.commit() + ", tx=" + tx + ']', e);
 
+            IgniteInternalFuture<IgniteInternalTx> res = null;
+
             if (tx != null) {
                 IgniteInternalFuture<IgniteInternalTx> rollbackFut = tx.rollbackAsync();
 
                 // Only for error logging.
                 rollbackFut.listen(CU.errorLogger(log));
 
-                return rollbackFut;
+                res = rollbackFut;
             }
 
-            return new GridFinishedFuture<>(e);
+            if (e instanceof Error)
+                throw (Error)e;
+
+            return res == null ? new GridFinishedFuture<IgniteInternalTx>(e) : res;
         }
     }
 
@@ -668,6 +679,9 @@ public class IgniteTxHandler {
         catch (Throwable e) {
             U.error(log, "Failed completing transaction [commit=" + commit + ", tx=" + tx + ']', e);
 
+            if (e instanceof Error)
+                throw e;
+
             if (tx != null)
                 return tx.rollbackAsync();
 
@@ -883,6 +897,9 @@ public class IgniteTxHandler {
             catch (IgniteCheckedException ex) {
                 U.error(log, "Failed to invalidate transaction: " + tx, ex);
             }
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
     }
 
@@ -918,6 +935,9 @@ public class IgniteTxHandler {
             tx.systemInvalidate(true);
 
             tx.rollback();
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
     }
 
@@ -941,6 +961,9 @@ public class IgniteTxHandler {
             }
             else
                 U.error(log, "Failed to send finish response to node [nodeId=" + nodeId + ", res=" + res + ']', e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
index 5bd4fdf..3d3e77f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxLocalAdapter.java
@@ -431,6 +431,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
         catch (Throwable e) {
             setRollbackOnly();
 
+            if (e instanceof Error)
+                throw e;
+
             throw new IgniteCheckedException("Transaction validation produced a runtime exception: " + this, e);
         }
     }
@@ -643,6 +646,9 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                 // Safe to remove transaction from committed tx list because nothing was committed yet.
                 cctx.tm().removeCommittedTx(this);
 
+                if (ex instanceof Error)
+                    throw (Error)ex;
+
                 throw new IgniteCheckedException("Failed to commit transaction to database: " + this, ex);
             }
         }
@@ -970,8 +976,14 @@ public abstract class IgniteTxLocalAdapter extends IgniteTxAdapter
                             }
                             catch (Throwable ex1) {
                                 U.error(log, "Failed to uncommit transaction: " + this, ex1);
+
+                                if (ex1 instanceof Error)
+                                    throw ex1;
                             }
 
+                            if (ex instanceof Error)
+                                throw ex;
+
                             throw err;
                         }
                     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
index 1fe0223..658557e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/closure/GridClosureProcessor.java
@@ -760,6 +760,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                             U.error(log, "Closure execution failed with error.", e);
 
                         fut.onDone(U.cast(e));
+
+                        if (e instanceof Error)
+                            throw e;
                     }
                 }
             };
@@ -819,9 +822,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
             return runLocal(c, plc);
         }
         catch (Throwable e) {
-            if (e instanceof Error)
+            if (e instanceof Error) {
                 U.error(log, "Closure execution failed with error.", e);
 
+                throw (Error)e;
+            }
+
             // If execution was rejected - rerun locally.
             if (e.getCause() instanceof RejectedExecutionException) {
                 U.warn(log, "Closure execution has been rejected (will execute in the same thread) [plc=" + plc +
@@ -833,9 +839,12 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                     return new GridFinishedFuture();
                 }
                 catch (Throwable t) {
-                    if (t instanceof Error)
+                    if (t instanceof Error) {
                         U.error(log, "Closure execution failed with error.", t);
 
+                        throw t;
+                    }
+
                     return new GridFinishedFuture(U.cast(t));
                 }
             }
@@ -890,6 +899,9 @@ public class GridClosureProcessor extends GridProcessorAdapter {
                             U.error(log, "Closure execution failed with error.", e);
 
                         fut.onDone(U.cast(e));
+
+                        if (e instanceof Error)
+                            throw (Error)e;
                     }
                 }
             };

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileWorkerBatch.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileWorkerBatch.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileWorkerBatch.java
index 5b92c84..1a2f3cb 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileWorkerBatch.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileWorkerBatch.java
@@ -151,6 +151,9 @@ public abstract class IgfsFileWorkerBatch implements Runnable {
         catch (Throwable e) {
             // Safety. This should never happen under normal conditions.
             err = e;
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             // Order of events is very important here. First, we close the stream so that metadata locks are released.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsThread.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsThread.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsThread.java
index 3523bc8..f64fc3e 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsThread.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsThread.java
@@ -52,16 +52,22 @@ public abstract class IgfsThread extends Thread {
             X.error("Failed to execute IGFS ad-hoc thread: " + e.getMessage());
 
             e.printStackTrace();
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             try {
                 cleanup();
             }
             // Catch all.
-            catch (Throwable e) {
+            catch (Throwable  e) {
                 X.error("Failed to clean up IGFS ad-hoc thread: " + e.getMessage());
 
                 e.printStackTrace();
+
+                if (e instanceof Error)
+                    throw e;
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
index b691180..d1ee5ad 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/job/GridJobWorker.java
@@ -400,6 +400,9 @@ public class GridJobWorker extends GridWorker implements GridTimeoutObject {
             ex = handleThrowable(e);
 
             assert ex != null;
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             if (ex != null)
@@ -521,6 +524,9 @@ public class GridJobWorker extends GridWorker implements GridTimeoutObject {
             ex = handleThrowable(e);
 
             assert ex != null;
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
         finally {
             // Finish here only if not held by this thread.
@@ -617,6 +623,9 @@ public class GridJobWorker extends GridWorker implements GridTimeoutObject {
         catch (Throwable e) {
             U.error(log, "Failed to cancel job due to undeclared user exception [jobId=" + ses.getJobId() +
                 ", ses=" + ses + ']', e);
+
+            if (e instanceof Error)
+                throw e;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
index 35e8d73..2ed6c62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java
@@ -351,6 +351,9 @@ public class GridQueryProcessor extends GridProcessorAdapter {
                     log.error("Failed to rebuild indexes for type: " + desc.name(), e);
 
                     fut.onDone(e);
+
+                    if (e instanceof Error)
+                        throw e;
                 }
             }
         };

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
index 4bc87ad..52ca610 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/GridRestProcessor.java
@@ -123,6 +123,9 @@ public class GridRestProcessor extends GridProcessorAdapter {
                             U.error(log, "Client request execution failed with error.", e);
 
                         fut.onDone(U.cast(e));
+
+                        if (e instanceof Error)
+                            throw e;
                     }
                     finally {
                         workersCnt.decrement();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/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 f57a627..22d1ff0 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
@@ -819,6 +819,9 @@ public class GridServiceProcessor extends GridProcessorAdapter {
                             catch (Throwable e) {
                                 log.error("Service execution stopped with error [name=" + svcCtx.name() +
                                     ", execId=" + svcCtx.executionId() + ']', e);
+
+                                if (e instanceof Error)
+                                    throw (Error)e;
                             }
                             finally {
                                 // Suicide.
@@ -872,6 +875,9 @@ public class GridServiceProcessor extends GridProcessorAdapter {
             catch (Throwable e) {
                 log.error("Failed to cancel service (ignoring) [name=" + svcCtx.name() +
                     ", execId=" + svcCtx.executionId() + ']', e);
+
+                if (e instanceof Error)
+                    throw e;
             }
             finally {
                 try {
@@ -1243,6 +1249,9 @@ public class GridServiceProcessor extends GridProcessorAdapter {
             }
             catch (Throwable t) {
                 log.error("Error when executing service: " + svcName.get(), t);
+
+                if (t instanceof Error)
+                    throw t;
             }
             finally {
                 busyLock.leaveBusy();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
index 3e2d013..f6d686c 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskWorker.java
@@ -458,6 +458,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
             U.error(log, errMsg, e);
 
             finishTask(null, new ComputeUserUndeclaredException(errMsg, e));
+
+            if (e instanceof Error)
+                throw e;
         }
     }
 
@@ -885,6 +888,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
                     // hence forced to fail the whole deployed task.
                     finishTask(null, tmp);
 
+                    if (e instanceof Error)
+                        throw e;
+
                     return null;
                 }
             }
@@ -938,6 +944,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
             U.error(log, errMsg, e);
 
             userE = new ComputeUserUndeclaredException(errMsg ,e);
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             finishTask(reduceRes, userE);
@@ -998,6 +1007,9 @@ class GridTaskWorker<T, R> extends GridWorker implements GridTimeoutObject {
 
             finishTask(null, new ComputeUserUndeclaredException(errMsg, e));
 
+            if (e instanceof Error)
+                throw (Error)e;
+
             return false;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
index c72a895..81ff72b 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java
@@ -134,6 +134,9 @@ public class GridTimeoutProcessor extends GridProcessorAdapter {
                         }
                         catch (Throwable e) {
                             U.error(log, "Error when executing timeout callback: " + timeoutObj, e);
+
+                            if (e instanceof Error)
+                                throw e;
                         }
                     }
                     else

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
index 1aac985..901274d 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
@@ -7975,7 +7975,7 @@ public abstract class IgniteUtils {
 
             return true;
         }
-        catch (Throwable ignored) {
+        catch (Exception ignored) {
             return false;
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/loopback/IpcServerTcpEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/loopback/IpcServerTcpEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/loopback/IpcServerTcpEndpoint.java
index ccb6d02..7a4cc69 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/loopback/IpcServerTcpEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/loopback/IpcServerTcpEndpoint.java
@@ -168,7 +168,7 @@ public class IpcServerTcpEndpoint implements IpcServerEndpoint {
                 }
             }
             catch (Throwable t) {
-                if (t instanceof IgniteCheckedException)
+                if (t instanceof IgniteCheckedException || t instanceof Error)
                     throw t;
 
                 throw new IgniteCheckedException("Invalid value '" + e.getValue() + "' of the property '" + e.getKey() + "' in " +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
index 4f43474..86a0886 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/ipc/shmem/IpcSharedMemoryServerEndpoint.java
@@ -496,7 +496,7 @@ public class IpcSharedMemoryServerEndpoint implements IpcServerEndpoint {
                 }
             }
             catch (Throwable t) {
-                if (t instanceof IgniteCheckedException)
+                if (t instanceof IgniteCheckedException || t instanceof Error)
                     throw t;
 
                 throw new IgniteCheckedException("Invalid value '" + e.getValue() + "' of the property '" + e.getKey() + "' in " +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
index c7574f3..c86c5a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridFunc.java
@@ -550,7 +550,7 @@ public class GridFunc {
 
                     return (R)mtd.invoke(t, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }
@@ -586,7 +586,7 @@ public class GridFunc {
 
                     mtd.invoke(t, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }
@@ -624,7 +624,7 @@ public class GridFunc {
 
                     return (R)mtd.invoke(o, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }
@@ -661,7 +661,7 @@ public class GridFunc {
 
                     mtd.invoke(o, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }
@@ -701,7 +701,7 @@ public class GridFunc {
 
                     return (R)mtd.invoke(null, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }
@@ -738,7 +738,7 @@ public class GridFunc {
 
                     mtd.invoke(null, args);
                 }
-                catch (Throwable e) {
+                catch (Exception e) {
                     throw wrap(e);
                 }
             }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/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 9a7c1fa..88fad71 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
@@ -580,6 +580,9 @@ public class GridNioServer<T> {
             U.close(srvrCh, log);
             U.close(selector, log);
 
+            if (e instanceof Error)
+                throw (Error)e;
+
             throw new IgniteCheckedException("Failed to initialize NIO selector.", e);
         }
     }
@@ -1169,6 +1172,9 @@ public class GridNioServer<T> {
             }
             catch (Throwable e) {
                 U.error(log, "Caught unhandled exception in NIO worker thread (restart the node).", e);
+
+                if (e instanceof Error)
+                    throw e;
             }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java
index fe48475..d5c5314 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/typedef/X.java
@@ -255,7 +255,7 @@ public final class X {
             return !deep ? shallowClone(obj) : (T)deepClone(new GridLeanMap<Integer, Integer>(),
                 new ArrayList<>(), obj, honorCloneable);
         }
-        catch (Throwable e) {
+        catch (Exception e) {
             throw new IgniteException("Unable to clone instance of class: " + obj.getClass(), e);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
index 1dc682b..99fa270 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/util/worker/GridWorker.java
@@ -124,6 +124,9 @@ public abstract class GridWorker implements Runnable {
                 U.error(log, "Runtime error caught during grid runnable execution: " + this, e);
             else
                 U.warn(log, "Runtime exception occurred during grid runnable execution caused by thread interruption: " + e.getMessage());
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             synchronized (mux) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorResolveHostNameTask.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorResolveHostNameTask.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorResolveHostNameTask.java
index ea7eb91..76e610f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorResolveHostNameTask.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/misc/VisorResolveHostNameTask.java
@@ -89,7 +89,7 @@ public class VisorResolveHostNameTask extends VisorOneNodeTask<Void, Map<String,
                         res.put(ip, hostName);
                 }
             }
-            catch (Throwable e) {
+            catch (Exception e) {
                 throw new IgniteException("Failed to resolve host name", e);
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
index c77ad2d..ceead59 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/visor/node/VisorNodeDataCollectorJob.java
@@ -105,6 +105,9 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
         }
         catch (Throwable eventsEx) {
             res.eventsEx(eventsEx);
+
+            if (eventsEx instanceof Error)
+                throw eventsEx;
         }
     }
 
@@ -139,6 +142,9 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
         }
         catch (Throwable cachesEx) {
             res.cachesEx(cachesEx);
+
+            if (cachesEx instanceof Error)
+                throw (Error)cachesEx;
         }
     }
 
@@ -174,6 +180,9 @@ public class VisorNodeDataCollectorJob extends VisorJob<VisorNodeDataCollectorTa
         }
         catch (Throwable igfssEx) {
             res.igfssEx(igfssEx);
+
+            if (igfssEx instanceof Error)
+                throw igfssEx;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/messaging/MessagingListenActor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/messaging/MessagingListenActor.java b/modules/core/src/main/java/org/apache/ignite/messaging/MessagingListenActor.java
index 486069f..04b640f 100644
--- a/modules/core/src/main/java/org/apache/ignite/messaging/MessagingListenActor.java
+++ b/modules/core/src/main/java/org/apache/ignite/messaging/MessagingListenActor.java
@@ -74,6 +74,9 @@ public abstract class MessagingListenActor<T> implements IgniteBiPredicate<UUID,
         }
         catch (Throwable e) {
             onError(e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
 
         return keepGoing;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiThread.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiThread.java b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiThread.java
index 313807d..5682868 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiThread.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiThread.java
@@ -71,6 +71,9 @@ public abstract class IgniteSpiThread extends Thread {
         // not to kill any threads from the underlying thread pool.
         catch (Throwable e) {
             U.error(log, "Runtime error caught during grid runnable execution: " + this, e);
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             cleanup();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
index b40bf75..6a5eb25 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java
@@ -1223,6 +1223,9 @@ public class TcpDiscoverySpi extends TcpDiscoverySpiAdapter implements TcpDiscov
             catch (Throwable t) {
                 fut.onDone(t);
 
+                if (t instanceof Error)
+                    throw t;
+
                 throw U.cast(t);
             }
             finally {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
index f286cd3..4ddbbd0 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineStartup.java
@@ -120,7 +120,7 @@ public final class CommandLineStartup {
 
             appCls.getDeclaredMethod("setAboutHandler", aboutHndCls).invoke(osxApp, aboutHndProxy);
         }
-        catch (Throwable ignore) {
+        catch (Exception ignore) {
             // Ignore.
         }
     }
@@ -297,6 +297,9 @@ public final class CommandLineStartup {
 
             exit("Failed to start grid: " + e.getMessage() + note, false, -1);
 
+            if (e instanceof Error)
+                throw e;
+
             return;
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
index cfed5e9..6b2c809 100644
--- a/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
+++ b/modules/core/src/main/java/org/apache/ignite/startup/cmdline/CommandLineTransformer.java
@@ -90,6 +90,9 @@ public class CommandLineTransformer {
 
             if (ps != null)
                 ps.println(TRANSFORMATION_FAILED_FLAG);
+
+            if (t instanceof Error)
+                throw (Error)t;
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
index 76e9a43..d0a327e 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/HadoopDefaultJobInfo.java
@@ -103,6 +103,9 @@ public class HadoopDefaultJobInfo implements HadoopJobInfo, Externalizable {
         }
         // NB: java.lang.NoClassDefFoundError may be thrown from Class#getConstructor() call.
         catch (Throwable t) {
+            if (t instanceof Error)
+                throw (Error)t;
+            
             throw new IgniteCheckedException(t);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsIpcIo.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsIpcIo.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsIpcIo.java
index 7d590c7..0264e7b 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsIpcIo.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/igfs/HadoopIgfsIpcIo.java
@@ -589,6 +589,9 @@ public class HadoopIgfsIpcIo implements HadoopIgfsIo {
                     log.error("Failed to obtain endpoint input stream (connection will be closed)", e);
 
                 err = e;
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
             finally {
                 close0(err);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
index 3757060..2f07817 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/jobtracker/HadoopJobTracker.java
@@ -1042,7 +1042,7 @@ public class HadoopJobTracker extends HadoopComponent {
             try {
                 fut.get();
             }
-            catch (Throwable e) {
+            catch (Exception e) {
                 if (e.getCause() instanceof HadoopTaskCancelledException)
                     return true;
             }
@@ -1086,6 +1086,9 @@ public class HadoopJobTracker extends HadoopComponent {
             }
             catch (Throwable e) {
                 U.error(log, "Unhandled exception while processing event.", e);
+
+                if (e instanceof Error)
+                    throw (Error)e;
             }
             finally {
                 busyLock.readUnlock();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
index 2b36267..2e04ac1 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/HadoopRunnableTask.java
@@ -138,6 +138,9 @@ public abstract class HadoopRunnableTask implements Callable<Void> {
             err = e;
 
             U.error(log, "Task execution failed.", e);
+
+            if (e instanceof Error)
+                throw e;
         }
         finally {
             execEndTs = U.currentTimeMillis();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
index 0791d1e..66fb42a 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/taskexecutor/external/HadoopExternalTaskExecutor.java
@@ -398,6 +398,9 @@ public class HadoopExternalTaskExecutor extends HadoopTaskExecutorAdapter {
                 }
                 catch (Throwable e) {
                     fut.onDone(new IgniteCheckedException("Failed to initialize child process: " + job, e));
+
+                    if (e instanceof Error)
+                        throw (Error)e;
                 }
                 finally {
                     busyLock.readUnlock();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
index e3c2bfa..d265ca8 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2Job.java
@@ -172,7 +172,10 @@ public class HadoopV2Job implements HadoopJob {
                 }
             }
             catch (Throwable e) {
-                throw transformException(e);
+                if (e instanceof Error)
+                    throw (Error)e;
+                else
+                    throw transformException(e);
             }
         }
         finally {
@@ -235,6 +238,9 @@ public class HadoopV2Job implements HadoopJob {
 
             fut.onDone(te);
 
+            if (e instanceof Error)
+                throw (Error)e;
+
             throw te;
         }
     }
@@ -287,6 +293,9 @@ public class HadoopV2Job implements HadoopJob {
                 catch (Throwable e) {
                     if (err == null)
                         err = e;
+
+                    if (e instanceof Error)
+                        throw (Error)e;
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
----------------------------------------------------------------------
diff --git a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
index 24f10a6..e9c859bd 100644
--- a/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
+++ b/modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/v2/HadoopV2TaskContext.java
@@ -183,6 +183,9 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
                 task = createTask();
             }
             catch (Throwable e) {
+                if (e instanceof Error)
+                    throw e;
+
                 throw transformException(e);
             }
 
@@ -193,6 +196,9 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
                 task.run(this);
             }
             catch (Throwable e) {
+                if (e instanceof Error)
+                    throw e;
+
                 throw transformException(e);
             }
         }
@@ -242,6 +248,9 @@ public class HadoopV2TaskContext extends HadoopTaskContext {
             locFs.setWorkingDirectory(new Path(locDir.getAbsolutePath()));
         }
         catch (Throwable e) {
+            if (e instanceof Error)
+                throw (Error)e;
+
             throw transformException(e);
         }
         finally {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 747ccb1..918a541 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -270,6 +270,9 @@ public class GridMapQueryExecutor {
             U.error(log, "Failed to execute local query: " + req, e);
 
             sendError(node, req.requestId(), e);
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
         finally {
             h2.setFilters(null);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
----------------------------------------------------------------------
diff --git a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
index 9c60c61..fac9818 100644
--- a/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
+++ b/modules/rest-http/src/main/java/org/apache/ignite/internal/processors/rest/protocols/http/jetty/GridJettyRestHandler.java
@@ -272,6 +272,9 @@ public class GridJettyRestHandler extends AbstractHandler {
             U.error(log, "Failed to process HTTP request [action=" + act + ", req=" + req + ']', e);
 
             cmdRes = new GridRestResponse(STATUS_FAILED, e.getMessage());
+
+            if (e instanceof Error)
+                throw (Error)e;
         }
 
         JsonConfig cfg = new GridJettyJsonConfig();

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
index 5ab5a81..00d1bc8 100644
--- a/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
+++ b/modules/schema-import/src/main/java/org/apache/ignite/schema/ui/SchemaImportApp.java
@@ -679,7 +679,7 @@ public class SchemaImportApp extends Application {
 
                 drivers.put(jdbcDrvCls, drv);
             }
-            catch (Throwable e) {
+            catch (Exception e) {
                 throw new IllegalStateException(e);
             }
         }
@@ -737,7 +737,7 @@ public class SchemaImportApp extends Application {
                     if (jarFolder.exists())
                         fc.setInitialDirectory(jarFolder);
                 }
-                catch (Throwable ignored) {
+                catch (Exception ignored) {
                     // No-op.
                 }
 
@@ -942,7 +942,7 @@ public class SchemaImportApp extends Application {
                     if (outFolder.exists())
                         dc.setInitialDirectory(outFolder);
                 }
-                catch (Throwable ignored) {
+                catch (Exception ignored) {
                     // No-op.
                 }
 
@@ -1548,7 +1548,7 @@ public class SchemaImportApp extends Application {
                 appCls.getDeclaredMethod("setDockIconImage", java.awt.Image.class)
                     .invoke(osxApp, fromFXImage(image("ignite", 128), null));
             }
-            catch (Throwable ignore) {
+            catch (Exception ignore) {
                 // No-op.
             }
         }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/bc89338f/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentClassLoader.java b/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentClassLoader.java
index e15215c..3d57cf6 100644
--- a/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentClassLoader.java
+++ b/modules/urideploy/src/main/java/org/apache/ignite/spi/deployment/uri/GridUriDeploymentClassLoader.java
@@ -65,7 +65,7 @@ class GridUriDeploymentClassLoader extends URLClassLoader {
             }
             // Catch Throwable to secure against any errors resulted from
             // corrupted class definitions or other user errors.
-            catch (Throwable e) {
+            catch (Exception e) {
                 throw new ClassNotFoundException("Failed to load class due to unexpected error: " + name, e);
             }
         }
@@ -96,7 +96,7 @@ class GridUriDeploymentClassLoader extends URLClassLoader {
             }
             // Catch Throwable to secure against any errors resulted from
             // corrupted class definitions or other user errors.
-            catch (Throwable e) {
+            catch (Exception e) {
                 throw new ClassNotFoundException("Failed to load class due to unexpected error: " + name, e);
             }
         }


Mime
View raw message