File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
server/src/main/java/org/elasticsearch/reservedstate/service Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1+ pr : 90302
2+ summary : Fix another potential race in the file settings watcher
3+ area : Infra/Core
4+ type : bug
5+ issues : [89500]
Original file line number Diff line number Diff line change @@ -341,6 +341,7 @@ synchronized void stopWatcher() {
341341 logger .debug ("stopping watcher ..." );
342342 if (watching ()) {
343343 try {
344+ // make sure the watcher thread hits the processing latch correctly
344345 cleanupWatchKeys ();
345346 fileUpdateState = null ;
346347 watchService .close ();
@@ -350,6 +351,8 @@ synchronized void stopWatcher() {
350351 if (watcherThreadLatch != null ) {
351352 watcherThreadLatch .await ();
352353 }
354+ // the watcher thread might have snuck in behind us and re-created the settings watch again
355+ cleanupWatchKeys ();
353356 } catch (IOException e ) {
354357 logger .warn ("encountered exception while closing watch service" , e );
355358 } catch (InterruptedException interruptedException ) {
You can’t perform that action at this time.
0 commit comments