zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shralex <...@git.apache.org>
Subject [GitHub] zookeeper pull request #167: commitProcessor does not crash when an unseen c...
Date Fri, 10 Feb 2017 08:06:45 GMT
Github user shralex commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/167#discussion_r100486459
  
    --- Diff: src/java/main/org/apache/zookeeper/server/quorum/CommitProcessor.java ---
    @@ -251,27 +252,29 @@ public void run() {
                         LinkedList<Request> sessionQueue = pendingRequests
                                 .get(request.sessionId);
                         if (sessionQueue != null) {
    +                        Request topPending = sessionQueue.peekFirst();
                             // If session queue != null, then it is also not empty.
    -                        Request topPending = sessionQueue.poll();
    -                        if (request.cxid != topPending.cxid) {
    -                            LOG.error(
    -                                    "Got cxid 0x"
    -                                            + Long.toHexString(request.cxid)
    -                                            + " expected 0x" + Long.toHexString(
    -                                                    topPending.cxid)
    -                                    + " for client session id "
    -                                    + Long.toHexString(request.sessionId));
    -                            throw new IOException("Error: unexpected cxid for"
    -                                    + "client session");
    +                        // we can get commit requests for requests before we even get
this session
    +                        //(see ZOOKEEPER-2684). We will just pass those commits to the
next processor.
    --- End diff --
    
    please remove the new comments from here and add them inside the if, where this case is
handled.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message