[
https://issues.apache.org/jira/browse/CURATOR-208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15103941#comment-15103941
]
ASF GitHub Bot commented on CURATOR-208:
----------------------------------------
Github user cammckenzie commented on a diff in the pull request:
https://github.com/apache/curator/pull/125#discussion_r49953173
--- Diff:
curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
---
@@ -257,8 +258,7 @@ public void stateChanged(CuratorFramework client,
ConnectionState newState)
client.start();
- executorService = Executors.newFixedThreadPool(2,
threadFactory); // 1 for listeners, 1 for background ops
-
+ executorService =
Executors.newSingleThreadScheduledExecutor(threadFactory);
--- End diff --
Is there a reason that this has gone from a 2 thread pool to a single
thread pool? Looking at the old code, it would seem that only 1 is used (for
the background loop), but just double checking.
> InterProcessSemaphoreV2 swallows InterruptedException
> -----------------------------------------------------
>
> Key: CURATOR-208
> URL: https://issues.apache.org/jira/browse/CURATOR-208
> Project: Apache Curator
> Issue Type: Bug
> Components: Recipes
> Affects Versions: 2.6.0, 2.7.1
> Reporter: Alexei Osipov
> Priority: Minor
> Labels: easyfix
>
> {{InterProcessSemaphoreV2}} incorrectly processes {{InterruptedException}}.
> Method `InterProcessSemaphoreV2#makeLease(final String path)` contains code
> block
> {code}
> try
> {
> client.delete().guaranteed().forPath(path);
> }
> catch ( KeeperException.NoNodeException e )
> {
> log.warn("Lease already released", e);
> }
> catch ( Exception e )
> {
> throw new IOException(e);
> }
> {code}
> The problem is that code in {{try}} block may throw an
> {{InterruptedException}} and this exception gets wrapped into {{IOException}}
> so it becomes very problematic to handle it properly.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)