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

jirapos...@reviews.apache.org commented on QPID-3269:
-----------------------------------------------------



bq.  On 2011-07-07 12:14:51, Gordon Sim wrote:
bq.  > 
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java,
 line 1069
bq.  > <https://reviews.apache.org/r/1027/diff/1/?file=22094#file22094line1069>
bq.  >
bq.  >     Could you not have used sync() here instead of a new method?
bq.  
bq.  rajith attapattu wrote:
bq.      I did wonder about this myself. But once a session is detached you can 
no longer sync on it right (from the broker side) ? (Bcos you need a valid 
session to sync on). 
bq.      Besides when the session is detached it's marked close on the client 
side, so sync wouldn't work anyways as we will throw a session closed exception.
bq.  
bq.  Gordon Sim wrote:
bq.      The point would be though that if you are sync()ing on the client side 
and the session is detached, that already wakes you up and throws an exception, 
right?
bq.      
bq.      I don't understand the second sentence. However your new method is 
throwing a session closed exception as well.
bq.  
bq.  rajith attapattu wrote:
bq.      Gordon, my bad, you don't need a new method sync would suffice. 
bq.      I just tested  using sync with a minor modification and it works.

Upon further testing it seems that sync() is not a good candidate here.
The condition used by sync to go into a wait position is that maxComplete (The 
commands completed so far) is less than point (the command you want to sync on).
However when we create the session both maxComplete and point are the same (i.e 
it's at -1) and hence it will not wait.

We can add another condition to make sync wait if point = -1.
Also in order to make it work, we need notify sync wait when we receive a 
detach/attach/close - so those methods would need to notify on the commands 
object.
So can make sync work with some modifications I hinted above, but that would 
need more testing to ensure it doesn't have any either unintended side effects.

sync() is used in the critical path a lot and at this juncture I think it's 
best to use new method rather than tinkering with sync().


- rajith


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/1027/#review985
-----------------------------------------------------------


On 2011-07-07 02:17:42, rajith attapattu wrote:
bq.  
bq.  -----------------------------------------------------------
bq.  This is an automatically generated e-mail. To reply, visit:
bq.  https://reviews.apache.org/r/1027/
bq.  -----------------------------------------------------------
bq.  
bq.  (Updated 2011-07-07 02:17:42)
bq.  
bq.  
bq.  Review request for qpid, Gordon Sim and Robbie Gemmell.
bq.  
bq.  
bq.  Summary
bq.  -------
bq.  
bq.  In order to verify the uniqueness of the client ID, a dummy session is 
created using client ID as it's name. This prevents any other connection from 
using same client ID as the session creation will fail. However this 
verification is switched off by default in order to preserve backwards 
compatibility. You need to use -Dqpid.verify_client_id=true switch verification 
on.
bq.  
bq.  In summary the following changes were made in order to support the above,
bq.  1. A verifyClientID method was added to the connection delegates,
bq.  2. AMQSession_0_10.java was modified to allow a name to be specified for 
the underlying AMQP session.
bq.  3. A method was added to o.a.q.transport.Session.java to wait until the 
session state was changed from NEW to OPEN (or another state which triggers the 
error).
bq.  4. Setter/Getter in Session.java to store/retrieve the SessionDetachCode 
and ConnectionDelegate to set the detach code.
bq.  5. SessionDelegate to notify Session object when attached/dettached/closed 
is invoked.
bq.  
bq.  
bq.  This addresses bug QPID-3269.
bq.      https://issues.apache.org/jira/browse/QPID-3269
bq.  
bq.  
bq.  Diffs
bq.  -----
bq.  
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_8_0.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQSession_0_10.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/configuration/ClientProperties.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/ConnectionDelegate.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Session.java
 1143628 
bq.    
http://svn.apache.org/repos/asf/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/SessionDelegate.java
 1143628 
bq.  
bq.  Diff: https://reviews.apache.org/r/1027/diff
bq.  
bq.  
bq.  Testing
bq.  -------
bq.  
bq.  A patch containing a test will be attached to the JIRA shortly.
bq.  
bq.  
bq.  Thanks,
bq.  
bq.  rajith
bq.  
bq.



>  Concurrently executing connections are allowed to use the same client ID
> -------------------------------------------------------------------------
>
>                 Key: QPID-3269
>                 URL: https://issues.apache.org/jira/browse/QPID-3269
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.6, 0.8, 0.10
>            Reporter: Rajith Attapattu
>            Assignee: Rajith Attapattu
>            Priority: Minor
>             Fix For: 0.11
>
>
> Section 4.3.2 of the JMS spec says that the JMS provider 
> should prevent concurrently executing clients from using the same client id.
> Qpid JMS client allows two connections to be created using the same client id.
> How reproducible:
> Always
> Steps to Reproduce:
> 1. Create two connections with the same client ID.
> 2. Observe that there are no exceptions being thrown.
> Actual results:
> No exception being thrown.
> Expected results:
> An exception should be thrown.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscr...@qpid.apache.org

Reply via email to