Menu

#214 LRU resizer and overager missing period

v2.4 (stable)
closed-fixed
5
2002-05-03
2002-05-02
No

This is actually a patch for v2.4.5RC3.

The resizer and overager tasks in
LRUEnterpriseContextCachePolicy run only once. In the
1.7.4.2 to 1.7.4.3 revision the parent class of both
timers was changed from org.jboss.util.TimerTask to
java.util.TimerTask. The org.jboss.util.TimerTask had a
constructor which set the period. java.util.TimerTask
doesn't. Hence the period is no longer being set in the
task.

I changed the Timer.schedule method calls to include
the period.

--- orig/LRUEnterpriseContextCachePolicy.java Sat Apr
27 19:05:46 2002
+++
src/org/jboss/ejb/plugins/LRUEnterpriseContextCachePolicy.java
Thu May 2 17:38:04 2002
@@ -126,13 +126,13 @@
if (m_resizerPeriod > 0)
{
m_resizer = new ResizerTask(m_resizerPeriod);
- tasksTimer.schedule(m_resizer,
(long)(Math.random() * m_resizerPeriod));
+ tasksTimer.schedule(m_resizer,
(long)(Math.random() * m_resizerPeriod), m_resizerPeriod);
}

if (m_overagerPeriod > 0)
{
m_overager = new OveragerTask(m_overagerPeriod);
- tasksTimer.schedule(m_overager,
(long)(Math.random() * m_overagerPeriod));
+ tasksTimer.schedule(m_overager,
(long)(Math.random() * m_overagerPeriod),
m_overagerPeriod);
}
}

Discussion

  • Victor Langelo

    Victor Langelo - 2002-05-02
    • milestone: 129789 --> v2.4 (stable)
     
  • Scott M Stark

    Scott M Stark - 2002-05-03

    Logged In: YES
    user_id=175228

    Ok thanks, good find. This has been applied for inclusion
    into 2.4.5.

     
  • Scott M Stark

    Scott M Stark - 2002-05-03
    • assigned_to: nobody --> starksm
    • status: open --> closed-fixed
     
  • marc fleury

    marc fleury - 2002-05-03

    Logged In: YES
    user_id=174548

    good catch.
    Is this in the 3.0 branch?

     

Log in to post a comment.