Bug 49170 - Transmission of duplicated session in DeltaManager#handleGET_ALL_SESSIONS.
Transmission of duplicated session in DeltaManager#handleGET_ALL_SESSIONS.
Status: RESOLVED FIXED
Product: Tomcat 6
Classification: Unclassified
Component: Cluster
6.0.26
All All
: P2 normal (vote)
: default
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-04-22 06:54 UTC by Keiichi Fujino
Modified: 2010-05-10 06:30 UTC (History)
0 users



Attachments
patch against trunk. (1.22 KB, text/plain)
2010-04-22 06:54 UTC, Keiichi Fujino
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Fujino 2010-04-22 06:54:01 UTC
Created attachment 25333 [details]
patch against trunk.

Config
<Manager className="org.apache.catalina.ha.session.DeltaManager"
         sendAllSessions="false"
         sendAllSessionsSize="XXXX" />

DeltaManager#handleGET_ALL_SESSIONS is as follows.
=====
...skip...
if (isSendAllSessions()) {
    sendSessions(sender, currentSessions, findSessionTimestamp);
} else {
    // send session at blocks
    int len = currentSessions.length < getSendAllSessionsSize() ? currentSessions.length : getSendAllSessionsSize();        Session[] sendSessions = new Session[len];
    for (int i = 0; i < currentSessions.length; i += getSendAllSessionsSize()) {
        len = i + getSendAllSessionsSize() > currentSessions.length ? currentSessions.length - i : getSendAllSessionsSize();
        System.arraycopy(currentSessions, i, sendSessions, 0, len);
        sendSessions(sender, sendSessions,findSessionTimestamp);
...skip...
    }
...skip...
}

=====

sendSessions maintains previous Session. 

For instance,
currentSessions=[ssA, ssB, ssC, ssD, ssE]
sendAllSessionsSize=3

loop1 : sendSessions=[ssA, ssB, ssC]
loop2 : sendSessions=[ssD, ssE, ssC]

ssC is transmitted two times.
It should be the following. 

loop1 :  sendSessions=[ssA, ssB, ssC]
loop2 : sendSessions=[ssD, ssE]

This problem exists in TC5.5, TC6.0, and TC7.0. 

I made a patch against trunk.

Best Regards.
Comment 1 Keiichi Fujino 2010-04-22 07:08:00 UTC
Fixed in trunk and proposed for 6.0.x and 5.5.x.
Comment 2 Keiichi Fujino 2010-05-10 06:29:36 UTC
This fix applied to 6.0, will be in 6.0.27 onwards.
Comment 3 Keiichi Fujino 2010-05-10 06:30:06 UTC
This fix applied to 5.5, will be in 5.5.30 onwards.