apache / apache/curator

[CURATOR-353] PathChildrenCache and PersistentNode interrupt each other if sharing the same executor

Open
#873 2 comments 0 reactions 0 assignees View on GitHub
bug imported-jira-issue
Dominant language
Java
Stars
3.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.