/** {@inheritDoc} */ @Override public boolean onFailure(Ignite ignite, FailureContext failureCtx) { return !ignoredFailureTypes.contains(failureCtx.type()) && handle(ignite, failureCtx); }
@Override protected boolean handle(Ignite ignite, FailureContext failureCtx) { if (failureCtx.type() != FailureType.SYSTEM_CRITICAL_OPERATION_TIMEOUT) return true; if (hndLatch != null) hndLatch.countDown(); return false; } };
@Override protected boolean handle(Ignite ignite, FailureContext failureCtx) { if (failureCtx.type() == FailureType.SYSTEM_WORKER_BLOCKED) hndLatch.countDown(); return false; } };
/** {@inheritDoc} */ @Override protected boolean handle(Ignite ignite, FailureContext failureCtx) { if (failureCtx.type() == FailureType.SYSTEM_WORKER_TERMINATION) failureHndThreadName = Thread.currentThread().getName(); return false; } }
/** {@inheritDoc} */ @Override public boolean segmented() { FailureProcessor failureProc = failure(); return failureProc != null && failureProc.failureContext() != null && failureProc.failureContext().type() == FailureType.SEGMENTATION; }
@Override public boolean handle(Ignite ignite, FailureContext failureCtx) { if (failureCtx.type() == FailureType.SYSTEM_WORKER_BLOCKED) return false; return super.handle(ignite, failureCtx); } } :
/** {@inheritDoc} */ @Override public boolean invalid() { FailureProcessor failureProc = failure(); return failureProc != null && failureProc.failureContext() != null && failureProc.failureContext().type() != FailureType.SEGMENTATION; }
/** * @throws Exception If failed. */ @Test public void testFailureHandlerTriggeredOnExchangeWorkerTermination() throws Exception { try { CountDownLatch latch = new CountDownLatch(1); TestFailureHandler hnd = new TestFailureHandler(false, latch); IgniteEx ignite = startGrid(getConfiguration().setFailureHandler(hnd)); GridCachePartitionExchangeManager<Object, Object> exchangeMgr = ignite.context().cache().context().exchange(); GridWorker exchangeWorker = GridTestUtils.getFieldValue(exchangeMgr, GridCachePartitionExchangeManager.class, "exchWorker"); assertNotNull(exchangeWorker); GridTestUtils.invoke(exchangeWorker, "addCustomTask", new ExchangeWorkerFailureTask()); assertTrue(latch.await(2000, TimeUnit.MILLISECONDS)); assertNotNull(hnd.failureCtx); assertEquals(hnd.failureCtx.type(), FailureType.SYSTEM_WORKER_TERMINATION); } finally { stopAllGrids(); } }
/** {@inheritDoc} */ public boolean onFailure(Ignite ignite, FailureContext failureCtx) { return !ignoredFailureTypes.contains(failureCtx.type()) && handle(ignite, failureCtx); }
/** {@inheritDoc} */ @Override public boolean invalid() { FailureProcessor failureProc = failure(); return failureProc != null && failureProc.failureContext() != null && failureProc.failureContext().type() != FailureType.SEGMENTATION; }
/** {@inheritDoc} */ @Override public boolean segmented() { FailureProcessor failureProc = failure(); return failureProc != null && failureProc.failureContext() != null && failureProc.failureContext().type() == FailureType.SEGMENTATION; }