You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Benjamin Reed (JIRA)" <ji...@apache.org> on 2008/10/22 08:08:44 UTC
[jira] Created: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
SetWatches needs to be the first message after auth messages to the server
--------------------------------------------------------------------------
Key: ZOOKEEPER-204
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
Project: Zookeeper
Issue Type: Bug
Components: java client
Affects Versions: 3.0.0
Reporter: Benjamin Reed
Fix For: 3.0.0
When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Assignee: (was: Benjamin Reed)
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated ZOOKEEPER-204:
------------------------------------
Status: Open (was: Patch Available)
the patch is missing the class TestableZookeeper. Ben can you upload the class with the patch?
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Flavio Paiva Junqueira (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645491#action_12645491 ]
Flavio Paiva Junqueira commented on ZOOKEEPER-204:
--------------------------------------------------
There is one point I don't understand. In the following:
{code:java}
@@ -702,6 +703,20 @@
bb.putInt(bb.capacity() - 4);
bb.rewind();
synchronized (outgoingQueue) {
+ // We add backwards since we are pushing into the front
+ if (!disableAutoWatchReset) {
+ SetWatches sw = new SetWatches(lastZxid,
+ zooKeeper.getDataWatches(),
+ zooKeeper.getExistWatches(),
+ zooKeeper.getChildWatches());
+ RequestHeader h = new RequestHeader();
+ h.setType(ZooDefs.OpCode.setWatches);
+ h.setXid(-8);
+ Packet packet = new Packet(h, new ReplyHeader(), sw, null, null,
+ null);
+ outgoingQueue.add(packet);
+ }
+
{code}
>From the description of the jira, it sounds like you want to do "outgoingQueue.addFirst(packet);" instead. Am I missing anything?
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Status: Patch Available (was: Open)
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Hudson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12649320#action_12649320 ]
Hudson commented on ZOOKEEPER-204:
----------------------------------
Integrated in ZooKeeper-trunk #149 (See [http://hudson.zones.apache.org/hudson/job/ZooKeeper-trunk/149/])
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt reassigned ZOOKEEPER-204:
--------------------------------------
Assignee: Benjamin Reed
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Affects Version/s: (was: 3.0.0)
3.1.0
Status: Patch Available (was: Open)
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.1.0
> Reporter: Benjamin Reed
> Fix For: 3.0.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Attachment: ZOOKEEPER-204.patch
Sorry Mahadev, added missing file.
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt updated ZOOKEEPER-204:
-----------------------------------
Fix Version/s: (was: 3.0.0)
3.1.0
Assignee: Benjamin Reed
Affects Version/s: (was: 3.1.0)
3.0.0
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.1.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated ZOOKEEPER-204:
------------------------------------
Attachment: ZOOKEEPER-204.patch
made a few changes regarding logging and formatting .... otherwise +1
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Patrick Hunt updated ZOOKEEPER-204:
-----------------------------------
Fix Version/s: 3.0.1
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Attachment: ZOOKEEPER-204.patch
This patch has a test case for the condition. It also fixes the problem by queuing the SetWatches right after the auth packets and before any other packets. While fixing the problem I also fixed the problem of exceptions that happen in callbacks killing the dispatch thread.
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Fix For: 3.0.0
>
> Attachments: ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Benjamin Reed (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Reed updated ZOOKEEPER-204:
------------------------------------
Attachment: ZOOKEEPER-204.patch
Good catch Flavio. Uploaded a fixed version.
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (ZOOKEEPER-204) SetWatches needs to be the first
message after auth messages to the server
Posted by "Mahadev konar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ZOOKEEPER-204?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mahadev konar updated ZOOKEEPER-204:
------------------------------------
Resolution: Fixed
Hadoop Flags: [Reviewed]
Status: Resolved (was: Patch Available)
Committed revision 718925 to trunk
and Committed revision 718926 to 3.0 branch.
Thanks ben.
> SetWatches needs to be the first message after auth messages to the server
> --------------------------------------------------------------------------
>
> Key: ZOOKEEPER-204
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-204
> Project: Zookeeper
> Issue Type: Bug
> Components: java client
> Affects Versions: 3.0.0
> Reporter: Benjamin Reed
> Assignee: Benjamin Reed
> Fix For: 3.0.1, 3.1.0
>
> Attachments: ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch, ZOOKEEPER-204.patch
>
>
> When the ZooKeeper java client makes a connection it queues a SetWatches request. The problem is that it puts the request at the end of the outgoing requests. This means that watches for requests that were queued before the connection is made and after the disconnect may improperly get their watches triggered.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.