[
https://issues.apache.org/jira/browse/ZOOKEEPER-2784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16016899#comment-16016899
]
ASF GitHub Bot commented on ZOOKEEPER-2784:
-------------------------------------------
Github user eribeiro commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/257#discussion_r117403350
--- Diff:
src/java/main/org/apache/zookeeper/server/quorum/QuorumCnxManager.java ---
@@ -660,6 +665,9 @@ public void run() {
"Ignoring exception", ie);
}
closeSocket(client);
+ } catch (ConfigException ce) {
+ LOG.error(ce.getMessage());
+ throw new RuntimeException(ce);
--- End diff --
Don't we have to call `closeSocket(client)` here before throwing the
`RuntimeException`? Relying on OS/JVM to close a socket can be too much
optimistic and leak resources. If I am right (please double check) then line
667 can be moved to a finally block just below this catch clause.
Also, as the program flow is interrupted if a `ConfigException` is thrown
lines 679-687 wouldn't be called and then `ServerSocket` also is not properly
closed, right?
PS: I am not sure, would have to look carefully later and don't have time
now, so excuse me if I am misunderstood it.
> Add some limitations on code level for `SID` to avoid configuration problem
> ---------------------------------------------------------------------------
>
> Key: ZOOKEEPER-2784
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2784
> Project: ZooKeeper
> Issue Type: Improvement
> Components: quorum
> Affects Versions: 3.5.2
> Reporter: Benedict Jin
> Fix For: 3.6.0
>
> Original Estimate: 168h
> Remaining Estimate: 168h
>
> As so far, `QuorumCnxManager#receiveConnection` cannot find out the same
> `SID` problem, then the Zookeeper cluster will start successfully. But the
> cluster is not health, and it will throw some problem like `not
> synchronized`. So, i thought we should add some limitations on code level for
> `SID` to find those configuration problem more early.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)