Bug 494630

Summary: Java failover not working as session attach fails
Product: Red Hat Enterprise MRG Reporter: Rajith Attapattu <rattapat+nobody>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED UPSTREAM QA Contact: Frantisek Reznicek <freznice>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 1.1.1CC: esammons, gsim, jross
Target Milestone: 1.1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-28 19:28:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to address the failover issue
none
Patch to be used in rpm none

Description Rajith Attapattu 2009-04-07 16:41:55 UTC
The java client currently fails to do proper failover due to session attach failing. This affects the currently published rpms.

Comment 1 Rajith Attapattu 2009-04-08 17:01:28 UTC
Created attachment 338758 [details]
Patch to address the failover issue

The java client failover issues was caused by a change in broker where it will not allow (since we don't support session resume) to use the same session name when attaching the session after failover.

This patch will create a new session id, instead of reusing the same when it tries to attach the session.

Comment 2 Rajith Attapattu 2009-04-08 17:32:25 UTC
Comment on attachment 338758 [details]
Patch to address the failover issue

Index: common/src/main/java/org/apache/qpid/transport/Session.java
===================================================================
--- common/src/main/java/org/apache/qpid/transport/Session.java (revision 763327)
+++ common/src/main/java/org/apache/qpid/transport/Session.java (working copy)
@@ -41,6 +41,7 @@
 import static org.apache.qpid.transport.util.Functions.*;
 import static org.apache.qpid.util.Serial.*;
 import static org.apache.qpid.util.Strings.*;
+import java.util.UUID;

 /**
  * Session
@@ -225,6 +226,7 @@
     void attach()
     {
         initReceiver();
+        name = new Binary(toUTF8(UUID.randomUUID().toString()));
         sessionAttach(name.getBytes());
         // XXX: when the broker and client support full session
         // recovery we should use expiry as the requested timeout

Comment 3 Rajith Attapattu 2009-04-08 17:37:43 UTC
Created attachment 338767 [details]
Patch to be used in rpm

I have reworked the patch so the import statements are not reorganized.
The attach patch has been simplified to show only the intended changes

Comment 4 Frantisek Reznicek 2009-04-14 12:33:58 UTC
The issue has been fixed, validated by long term run on RHEL 5.3 i386 / x86_64 on packages:
openais-0.80.3-22.el5_3.4
python-qpid-0.5.752581-1.el5
qpidc-0.5.752581-3.el5
qpidc-debuginfo-0.5.752581-3.el5
qpidc-devel-0.5.752581-3.el5
qpidc-perftest-0.5.752581-3.el5
qpidc-rdma-0.5.752581-3.el5
qpidc-ssl-0.5.752581-3.el5
qpidd-0.5.752581-3.el5
qpidd-acl-0.5.752581-3.el5
qpidd-cluster-0.5.752581-3.el5
qpidd-devel-0.5.752581-3.el5
qpidd-rdma-0.5.752581-3.el5
qpidd-ssl-0.5.752581-3.el5
qpidd-xml-0.5.752581-3.el5
qpid-java-client-0.5.751061-2.el5
qpid-java-common-0.5.751061-2.el5
rhm-0.5.3206-1.el5
rhm-docs-0.5.756148-1.el5

The test procedure consist of 'ant test -Dtest=FailoverTest -Dprofile=cpp.cluster' on packaged qpidd and compiled & patched java code from rev.751061.


->VERIFIED

Comment 5 Rajith Attapattu 2009-10-09 16:05:58 UTC
The attached patch results in session resources not cleaned properly.
The session 'name' was not designed to be mutable. If the name is changed during failover, then at connection close time only the current session is entry is removed and not the previous one.

Since then a broker fix has been made and now there is no need to apply this fix anyways. I will be removing this patch from 0:0.5.751061-9 in the java package

Comment 6 Justin Ross 2011-06-28 19:28:08 UTC
This has been fixed another way; closing.