Github user eribeiro commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/312#discussion_r128688135
--- Diff:
src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java ---
@@ -275,20 +307,9 @@ public synchronized void closeSession(long sessionId) {
@SuppressWarnings("unchecked")
private void closeSessionWithoutWakeup(long sessionId) {
- HashSet<NIOServerCnxn> cnxns;
- synchronized (this.cnxns) {
- cnxns = (HashSet<NIOServerCnxn>)this.cnxns.clone();
- }
-
- for (NIOServerCnxn cnxn : cnxns) {
- if (cnxn.getSessionId() == sessionId) {
- try {
- cnxn.close();
- } catch (Exception e) {
- LOG.warn("exception during session close", e);
- }
- break;
- }
+ NIOServerCnxn cnxn = sessionMap.remove(sessionId);
+ if (cnxn != null) {
+ cnxn.close();
--- End diff --
Why did you remove the `try-catch` block around `cnxn.close()`? We still
can have exceptions being thrown during `cnxn.close()`, right?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---