private boolean checkDSClosing(InternalDistributedSystem distributedSystem) { return distributedSystem == null || distributedSystem.isDisconnecting(); }
/** * check to see if the distributed system is closing * * @return true if the distributed system is closing */ private boolean checkDSClosing(ClusterDistributionManager dm) { InternalDistributedSystem ds = dm.getSystem(); return (ds == null || ds.isDisconnecting()); }
/** * check to see if the distributed system is closing * * @return true if the distributed system is closing */ private boolean checkDSClosing(ClusterDistributionManager dm) { InternalDistributedSystem ds = dm.getSystem(); return (ds == null || ds.isDisconnecting()); }
/** * check to see if the distributed system is closing * * @return true if the distributed system is closing */ public boolean checkDSClosing(ClusterDistributionManager dm) { InternalDistributedSystem ds = dm.getSystem(); return (ds == null || ds.isDisconnecting()); }
/** * check to see if the distributed system is closing * * @return true if the distributed system is closing */ public boolean checkDSClosing(ClusterDistributionManager dm) { InternalDistributedSystem ds = dm.getSystem(); return (ds == null || ds.isDisconnecting()); }
/** * Returns true if this DM or the DistributedSystem owned by it is closing or is closed. */ protected boolean isCloseInProgress() { if (closeInProgress) { return true; } InternalDistributedSystem ds = getSystem(); return ds != null && ds.isDisconnecting(); }
private void initiateLocalAbortForTest(final DistributionManager dm) { if (!dm.getSystem().isDisconnecting()) { if (logger.isDebugEnabled()) { logger.debug( "abortTest: Disconnecting from distributed system and sending null chunk to abort"); } // can't disconnect the distributed system in a thread owned by the ds, // so start a new thread to do the work Thread disconnectThread = new LoggingThread("InitialImageOperation abortTest Thread", () -> dm.getSystem().disconnect()); disconnectThread.start(); } // !isDisconnecting // ...end of abortTest code }
public boolean isOkayToSendResult() { return (sc.getAcceptor().isRunning() && !ids.isDisconnecting() && !sc.getCachedRegionHelper().getCache().isClosed() && !alreadySendException.get()); }
@Test public void processWithNullPointerExceptionFromOperationOnRegionWithNoSystemFailureAndIsDisconnectingSendsReplyWithRemoteOperationException() throws Exception { when(msg.operateOnRegion(dm, r, startTime)).thenThrow(NullPointerException.class); doNothing().when(msg).checkForSystemFailure(); when(system.isDisconnecting()).thenReturn(false).thenReturn(true); msg.setSender(sender); msg.process(dm); verify(dm, times(1)).putOutgoing(any()); ArgumentCaptor<ReplyException> captor = ArgumentCaptor.forClass(ReplyException.class); verify(msg, times(1)).sendReply(any(), anyInt(), eq(dm), captor.capture(), eq(r), eq(startTime)); assertThat(captor.getValue().getCause()).isInstanceOf(RemoteOperationException.class); }
@Test public void processWithDisconnectingDSAndClosedCacheSendsReplyContainingCachesClosedException() throws Exception { CacheClosedException reasonCacheWasClosed = mock(CacheClosedException.class); when(system.isDisconnecting()).thenReturn(true); when(cache.getCacheClosedException(any())).thenReturn(reasonCacheWasClosed); msg.setSender(sender); msg.process(dm); verify(msg, times(0)).operateOnRegion(dm, r, startTime); verify(dm, times(1)).putOutgoing(any()); ArgumentCaptor<ReplyException> captor = ArgumentCaptor.forClass(ReplyException.class); verify(msg, times(1)).sendReply(any(), anyInt(), eq(dm), captor.capture(), any(), eq(startTime)); assertThat(captor.getValue().getCause()).isSameAs(reasonCacheWasClosed); }
protected static void removeLockService(DLockService service) { service.removeAllTokens(); InternalDistributedSystem system = null; synchronized (services) { DLockService removedService = services.remove(service.getName()); if (removedService == null) { // another thread beat us to the removal... return return; } if (removedService != service) { services.put(service.getName(), removedService); } else { service.getStats().incServices(-1); } system = removedService.getDistributionManager().getSystem(); } // if disconnecting and this was the last service, cleanup! if (services.isEmpty() && system.isDisconnecting()) { // get rid of stats and thread group... synchronized (DLockService.class) { closeStats(); } } }
if (!ids.isDisconnecting()) { throw new InternalGemFireError( "TimeoutException should not be thrown here",
existingSystemDisconnecting = existingSystem.isDisconnecting();
@Test public void whenExceptionOccursThenLastResultReceivedMustNotBeSet() throws Exception { ServerToClientFunctionResultSender resultSender = getResultSender(); resultSender.ids = mock(InternalDistributedSystem.class); when(resultSender.ids.isDisconnecting()).thenReturn(false); Object object = mock(Object.class); resultSender.lastResultReceived = false; DistributedMember distributedMember = mock(DistributedMember.class); when(serverConnection.getPostAuthzRequest()) .thenThrow(new NotAuthorizedException("Should catch this exception")); CachedRegionHelper cachedRegionHelper = mock(CachedRegionHelper.class); when(serverConnection.getCachedRegionHelper()).thenReturn(cachedRegionHelper); InternalCache cache = mock(InternalCache.class); when(cachedRegionHelper.getCache()).thenReturn(cache); when(cache.isClosed()).thenReturn(false); expectedException.expect(NotAuthorizedException.class); resultSender.lastResult(object, distributedMember); assertFalse(resultSender.lastResultReceived); resultSender.lastResult(object); assertFalse(resultSender.lastResultReceived); }