kirklund commented on issue #4963:
URL: https://github.com/apache/geode/pull/4963#issuecomment-617886184


   @upthewaterspout, I have some questions about your review of Cache.close() 
changes.
   {noformat}
     @Override
     public void close(String reason, Throwable systemFailureCause, boolean 
keepAlive,
         boolean keepDS, boolean skipAwait) {
       securityService.close();
       if (isClosed()) {
         if (!skipAwait && 
!Thread.currentThread().equals(CLOSING_THREAD.get())) {
           waitUntilClosed();
         }
         return;
       }
       if (!keepDS && systemFailureCause == null
           && (isReconnecting() || system.getReconnectedSystem() != null)) {
         logger.debug(
             "Cache is shutting down distributed system connection. 
isReconnecting={} reconnectedSystem={} keepAlive={} keepDS={}",
             isReconnecting(), system.getReconnectedSystem(), keepAlive, 
keepDS);
         system.stopReconnectingNoDisconnect();
         if (system.getReconnectedSystem() != null) {
           system.getReconnectedSystem().disconnect();
         }
         return;
       }
       synchronized (GemFireCacheImpl.class) {
         // ALL CODE FOR CLOSE SHOULD NOW BE UNDER STATIC SYNCHRONIZATION OF 
GemFireCacheImpl.class
         // static synchronization is necessary due to static resources
         if (isClosed()) {
           if (!skipAwait && 
!Thread.currentThread().equals(CLOSING_THREAD.get())) {
             waitUntilClosed();
           }
           return;
         }
         CLOSING_THREAD.set(Thread.currentThread());
   {noformat}
   If I remove that 1st early-out, then all subsequent calls will repeatedly 
execute the block about the reconnecting system. I’ve read the code that it 
invokes — such as 
   {noformat}
   system.stopReconnectingNoDisconnect();
   {noformat}
   and 
   {noformat}
   system.getReconnectedSystem().disconnect()
   {noformat}
   … so far, I’m not convinced that it’s safe to remove the 1st early out. Are 
you sure it’s safe to invoke these calls more than once? The current behavior 
never invokes them more than once.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to