tkhurana opened a new pull request, #2601:
URL: https://github.com/apache/phoenix/pull/2601

   close() removed the instance from INSTANCES at the top, before a 
multi-second disruptor drain. A concurrent get() during that window missed the 
cache and constructed a second live instance for the same shard, producing two 
writers (confirmed in a captured abort log).
   
   Remove from the cache only after teardown, in a finally so a throwing 
teardown step cannot strand a closed instance (which would break the 
active->standby->active re-promotion path without a JVM restart). The removal 
is value-specific (remove(key, this)) so a later instance for the same key is 
never clobbered. The closed flag is still set first, so a get() during the 
drain returns the still-closing instance whose append()/sync() fail fast rather 
than a fresh writer.
   
   Add a cacheForTesting() seam and two regression tests:
   - testConcurrentGetDuringCloseDoesNotResurrectInstance
   - testCloseRemovesFromCacheEvenWhenTeardownThrows
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to