Bug 494630 - Java failover not working as session attach fails
Java failover not working as session attach fails
Status: CLOSED UPSTREAM
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java (Show other bugs)
1.1.1
All Linux
urgent Severity urgent
: 1.1.1
: ---
Assigned To: Rajith Attapattu
Frantisek Reznicek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-07 12:41 EDT by Rajith Attapattu
Modified: 2015-11-15 19:07 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-06-28 15:28:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to address the failover issue (2.44 KB, patch)
2009-04-08 13:01 EDT, Rajith Attapattu
no flags Details | Diff
Patch to be used in rpm (819 bytes, patch)
2009-04-08 13:37 EDT, Rajith Attapattu
no flags Details | Diff

  None (edit)
Description Rajith Attapattu 2009-04-07 12:41:55 EDT
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 13:01:28 EDT
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 13:32:25 EDT
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 13:37:43 EDT
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 08:33:58 EDT
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 12:05:58 EDT
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 15:28:08 EDT
This has been fixed another way; closing.

Note You need to log in before you can comment on or make changes to this bug.