Method org.jboss.web.tomcat.tc5.session.ClusteredSession.calcMaxUnreplicatedInterval
incorrectly treats maxInactiveInterval as milliseconds
-------------------------------------------------------------------------------------------------------------------------------------------
Key: JBAS-4428
URL:
http://jira.jboss.com/jira/browse/JBAS-4428
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: JBossAS-4.0.5.GA
Environment: Windows XP and Unisys MCP system
Reporter: Stephen Burdeau
When running the testsuite test org.jboss.test.cluster.test.ScopedSetTriggerTestCase, the
test fails on the following assertion:
junit.framework.ComparisonFailure: Attributes should be the same
expected:<...Ben...> but was:<...Joe...>
at
org.jboss.test.cluster.test.ScopedSetTriggerTestCase.testNonPrimitiveModify(ScopedSetTriggerTestCase.java:94)
at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
at junit.extensions.TestSetup.run(TestSetup.java:23)
This failure occurs when running on the Unisys MCP system, which demonstrates different
timings than when running on a system like Windows.
After analyzing the results and the code, the following appears to be the root cause of
the test failure:
org.jboss.web.tomcat.tc5.session.ClusteredSession has a method calcMaxUnreplicatedInterval
that is used to calculate maxUnreplicatedInterval. maxUnreplicatedInterval is the maximum
time interval before a session is replicated to the other cluster nodes. When this time
period is exceeded, the session is replicated even if the session is not
"dirty". maxUnreplicatedInterval is in milliseconds, but maxInactiveInterval is
in seconds. However, calcMaxUnreplicatedInterval computes maxUnreplicatedInterval as
follows:
maxUnreplicatedInterval = maxInactiveInterval * maxUnreplicatedFactor / 100;
where maxUnreplicatedFactor is 80. Since maxInactiveInterval is in seconds, the correct
computation should be:
maxUnreplicatedInterval = maxInactiveInterval * 1000 * maxUnreplicatedFactor /
100;
As a result of the incorrect computation of maxUnreplicatedInterval, the session is
automatically replicated much more often than was intended.
In this case, the session timeout was configured as 30 minutes or 1800 seconds. So,
maxUnreplicatedInterval becomes 1440 milliseconds. Therefore, if the test takes more than
about a second and a half to run, the test will not produce the expected results.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira