Affects Version/s: 6.1.7
Environment:HideLinux sputnik 126.96.36.199-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i686 i386 GNU/Linux
java version "1.5.0_12"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
ShowLinux sputnik 188.8.131.52-80.fc7 #1 SMP Sun Feb 10 17:29:10 EST 2008 i686 i686 i386 GNU/Linux java version "1.5.0_12" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04) Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
Number of attachments :
Terracotta session replication does not work with jetty 6.1.7 if the initial page visited at each server does not add attributes into the session state, but subsequent pages then add attributes. Each server must be visited before any server adds an attribute.
This is caused by a combination of TerracottaSessionManager.SessionData being constructed with a null attributes map, and TerracottaSessionManager.Session referencing that map on construction. When attributes are created, they may be created independently in the Session and the shared SessionData.
The attached file contains a webapp and the configuration and steps used to reproduce the problem. It also includes a patch that fixes the problem by always creating an attributes map SessionData on construction (there is probably a better way to fix this, but the patch works around the problem for me).
This is always reproducible if the exact sequence below is followed.
1. Start a single terracotta server on port 9990 with terracotta-config.xml
2. For each jetty installation
- copy greeting.xml into the contexts directory
- copy greeting.war into the webapps directory
- copy jetty-terracotta-sessions-6.1.7.jar into lib/ext
7. Submit a name several times to server 1
- The counter increments for each submit.
8. Submit a name several times to server 2
- State is not replicated to the 2nd server. The counter starts at 1