[CURATOR-353] PathChildrenCache and PersistentNode interrupt each other if sharing the same executor
In our example, we've got a PathChildrenCache and PersistentNode sharing the same executor.
This interacts badly with interrupts - when PathChildrenCache is closed, this calls CloseableExecutorService.close(), which interrupts all the current pending tasks via Future.cancel(true).
If PersistentNode is then closed, there's a chance that the deleteNode() will happen on a thread on the shared executor that was interrupted by the closing executor service. This throws InterruptedException, which is caught and rethrown as an IOException. This results in spurious failures in our tests when the close randomly throws IOException.
I'm not sure that re-throwing an InterruptedException as an IOException is a good idea - there's already code that re-sets the interrupt status on the thread, should it just leave it at that? Else it looks like the thread has been interrupted twice.
Originally reported by thecoop1984, imported from: PathChildrenCache and PersistentNode interrupt each other if sharing the same executor
- assignee: randgalt
- status: Open
- priority: Minor
- resolution: Unresolved
- imported: 2025-01-21
[Originally related to: CURATOR-375]