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 @@ -345,6 +345,7 @@ synchronized void stopWatcher() {
345345 logger .debug ("stopping watcher ..." );
346346 if (watching ()) {
347347 try {
348+ // make sure the watcher thread hits the processing latch correctly
348349 cleanupWatchKeys ();
349350 fileUpdateState = null ;
350351 watchService .close ();
@@ -354,6 +355,8 @@ synchronized void stopWatcher() {
354355 if (watcherThreadLatch != null ) {
355356 watcherThreadLatch .await ();
356357 }
358+ // the watcher thread might have snuck in behind us and re-created the settings watch again
359+ cleanupWatchKeys ();
357360 } catch (IOException e ) {
358361 logger .warn ("encountered exception while closing watch service" , e );
359362 } catch (InterruptedException interruptedException ) {
You can’t perform that action at this time.
0 commit comments