[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1479?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289643#comment-13289643
 ] 

Stephen Tyree commented on ZOOKEEPER-1479:
------------------------------------------

Aside from being used in unit tests, is there a use case for synchronous 
zoo_add_auth? The downside of this is that anyone using zoo_add_auth for 
synchronous work does marginally more work than they did before for no benefit, 
which is something that ideally would be avoided. If this is such an issue for 
developers (as I could imagine it being), maybe for development builds of 
Zookeeper there could be a preprocessor flag, say 
ZOOKEEPER_SYNCHRONOUS_ADD_AUTH, which wakes the IO thread following the call. 
Then release builds could simply not use the flag, and we end up getting the 
best of both worlds. 

On the one hand, this is ugly as sin and reeks of leaving printf's throughout 
your code to aid in debugging. But on the other, this gives the best of both 
worlds. Thoughts?
                
> C Client: zoo_add_auth() doesn't wake up the IO thread
> ------------------------------------------------------
>
>                 Key: ZOOKEEPER-1479
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1479
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: c client
>    Affects Versions: 3.4.3
>            Reporter: Michi Mutsuzaki
>             Fix For: 3.5.0
>
>
> It can take up to sessionTimeout / 3 for the IO thread to send out the auth 
> packet. The {{zoo_add_auth()}} function should call {{adaptor_send_queue(zh, 
> 0)}} after {{calling send_last_auth_info(zh)}}.
> --Michi

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to