[
https://issues.apache.org/jira/browse/ZOOKEEPER-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15359640#comment-15359640
]
Flavio Junqueira commented on ZOOKEEPER-1485:
---------------------------------------------
I'm not entirely convinced that this is the right way to address this issue. I
was having another look at ZOOKEEPER-22, which is something I'd really like to
see implemented eventually and I'm concerned that this approach of allowing the
same xid to appear twice in a session could create problems. Not repeating xid
values for a given session sounds like a cleaner abstraction compared to
wrapping around like this.
What if we fix by not making the xid static in the C client and getting a new
handle?
Also, it is important that we added test cases specially when there is a change
of behavior. Even if the change is trivial, we want to be able to test that
future changes won't break it.
> client xid overflow is not handled
> ----------------------------------
>
> Key: ZOOKEEPER-1485
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1485
> Project: ZooKeeper
> Issue Type: Bug
> Components: c client, java client
> Affects Versions: 3.4.3, 3.3.5
> Reporter: Michi Mutsuzaki
> Assignee: Martin Kuchta
> Attachments: ZOOKEEPER-1485.patch
>
>
> Both Java and C clients use signed 32-bit int as XIDs. XIDs are assumed to be
> non-negative, and zookeeper uses some negative values as special XIDs (e.g.
> -2 for ping, -4 for auth). However, neither Java nor C client ensures the
> XIDs it generates are non-negative, and the server doesn't reject negative
> XIDs.
> Pat had some suggestions on how to fix this:
> - (bin-compat) Expire the session when the client sends a negative XID.
> - (bin-incompat) In addition to expiring the session, use 64-bit int for XID
> so that overflow will practically never happen.
> --Michi
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)