dlmarion commented on issue #2689:
URL: https://github.com/apache/accumulo/issues/2689#issuecomment-1172619799

   > If what I did is correct,
   
   It wasn't. I was closing a different client ZK session. I believe that I 
have a test now that implements the order of operations from the original 
description. I had to move one line of code in `ZooPropStore.get` so that the 
watcher is registered *before* the call to `checkZKConnection`. Here is the 
test output:
   
   ```
   2022-07-01T18:38:54,281 [impl.PropStoreMetrics] DEBUG: Creating PropStore 
metrics
   2022-07-01T18:38:54,317 [metrics.MetricsUtil] INFO : Metric producer 
PropStoreMetrics initialize
   2022-07-01T18:38:54,319 [impl.ZooPropStore] DEBUG: Have a ZooKeeper 
connection and found instance node: 2a0af30d-5918-425d-b94e-78b66a466ccd
   2022-07-01T18:38:54,326 [impl.TestZooPropStore] INFO : 
super.checkZkConnection() called, calling runCloseConnectionTask
   2022-07-01T18:38:54,329 [server.ZooKeeperServer] INFO : Closing session 
0x10001954cc20002
   2022-07-01T18:38:54,433 [impl.PropStoreWatcher] DEBUG: ZooKeeper 
disconnected event received
   2022-07-01T18:38:54,435 [impl.ZooPropStore] TRACE: connectionEvent, clearing 
cache
   2022-07-01T18:38:55,945 [server.ZooKeeperServer] INFO : Invalid session 
0x10001954cc20002 for client /127.0.0.1:56280, probably expired
   2022-07-01T18:38:55,946 [zookeeper.ZooSession] DEBUG: Session expired; 
WatchedEvent state:Expired type:None path:null
   2022-07-01T18:38:55,947 [impl.PropStoreWatcher] INFO : ZooKeeper connection 
closed event received
   2022-07-01T18:38:55,947 [impl.ZooPropStore] TRACE: connectionEvent, clearing 
cache
   2022-07-01T18:38:56,327 [impl.TestZooPropStore] INFO : 
runCloseConnectionTask called, waiting for connection event to release latch
   2022-07-01T18:38:56,327 [impl.TestZooPropStore] INFO : latch released
   2022-07-01T18:38:56,327 [impl.PropCacheCaffeineImpl] TRACE: Called get() for 
SystemPropKey{InstanceId=2a0af30d-5918-425d-b94e-78b66a466ccd'}
   2022-07-01T18:38:56,335 [impl.ZooPropLoader] TRACE: load called for 
SystemPropKey{InstanceId=2a0af30d-5918-425d-b94e-78b66a466ccd'}
   2022-07-01T18:38:56,335 [zookeeper.ZooSession] DEBUG: Removing closed 
ZooKeeper session to 127.0.0.1:39327
   2022-07-01T18:38:56,335 [zookeeper.ZooSession] DEBUG: Connecting to 
127.0.0.1:39327 with timeout 5000 with auth
   2022-07-01T18:38:56,437 [server.ZooKeeperServer] INFO : got auth packet 
/127.0.0.1:56282
   2022-07-01T18:38:56,437 [server.ZooKeeperServer] INFO : Session 
0x10001954cc20003: auth success for scheme digest and address /127.0.0.1:56282
   2022-07-01T18:38:56,441 [impl.PropStoreMetrics] TRACE: Load time: 106
   2022-07-01T18:38:56,441 [impl.PropStoreMetrics] TRACE: Load count: 0 time:0.0
   ```
   
   Note that the connection event is received twice, once for `disconnect` and 
once for `close`, thus the cache is cleared twice. The connection to ZooKeeper 
is re-established so that the ZooPropLoader can load the properties.


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