[jboss-jira] [JBoss JIRA] Updated: (JBAS-4428) Method org.jboss.web.tomcat.tc5.session.ClusteredSession.calcMaxUnreplicatedInterval incorrectly treats maxInactiveInterval as milliseconds

Brian Stansberry (JIRA) jira-events at lists.jboss.org
Thu May 17 11:04:52 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBAS-4428?page=all ]

Brian Stansberry updated JBAS-4428:
-----------------------------------

          Component/s: Clustering
                       Web (Tomcat) service
        Fix Version/s:  JBossAS-5.0.0.Beta3
                       JBossAS-4.2.1.CR1
    Affects Version/s: JBossAS-5.0.0.Beta2
                       JBossAS-5.0.0.Beta1
                       JBossAS-4.0.4.GA
             Assignee: Brian Stansberry
           Complexity: Low

Yep, that calculation's wrong.  Thanks for the report.

> 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) 
>          Components: Web (Tomcat) service, Clustering
>    Affects Versions: JBossAS-5.0.0.Beta1, JBossAS-4.0.5.GA, JBossAS-4.0.4.GA, JBossAS-5.0.0.Beta2
>         Environment: Windows XP and Unisys MCP system
>            Reporter: Stephen Burdeau
>         Assigned To: Brian Stansberry
>             Fix For: JBossAS-4.2.1.CR1,  JBossAS-5.0.0.Beta3
>
>
> 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

        



More information about the jboss-jira mailing list