Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-770

Slow add_auth calls with multi-threaded client

Add voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.0, 3.3.3, 3.4.0
    • Fix Version/s: 3.8.0
    • Component/s: c client, contrib-bindings
    • Labels:
    • Environment:

      ubuntu lucid (10.04), zk trunk (3.4)


      Calls to add_auth are a bit slow from the c client library. The auth callback typically takes multiple seconds to fire. I instrumented the java, c binding, and python binding with a few log statements to find out where the slowness was occuring ( http://bazaar.launchpad.net/~hazmat/zookeeper/fast-auth-instrumented/revision/647). It looks like when the io thread polls, it doesn't register interest in the incoming packet, so the auth success message from the server and the auth callback are only processed when the poll timeouts. I tried modifying mt_adapter.c so the poll registers interest in both events, this causes a considerably more wakeups but it does address the issue of making add_auth fast. I think the ideal solution would be some sort of additional auth handshake state on the handle, that zookeeper_interest could utilize to suggest both POLLIN|POLLOUT are wanted for subsequent calls to poll during the auth handshake handle state.

      i'm attaching a script that takes 13s or 1.6s for the auth callback depending on the session time out value (which in turn figures into the calculation of the poll timeout).


        1. authtest.py
          1 kB
          Kapil Thangavelu
        2. ZOOKEEPER-770.patch
          3 kB
          Michi Mutsuzaki
        3. ZOOKEEPER-770.patch
          0.4 kB
          Michi Mutsuzaki
        4. ZOOKEEPER-770.patch
          2 kB
          Craig Calef
        5. ZOOKEEPER-770-FIX.patch
          0.4 kB
          Craig Calef

        Issue Links



            • Assignee:
              cdcalef Craig Calef
              kapilt Kapil Thangavelu


              • Created:

                Issue deployment