[jboss-svn-commits] JBL Code SVN: r29092 - in labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP: ArjunaCore/arjuna/etc and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 27 07:46:12 EDT 2009
Author: jhalliday
Date: 2009-08-27 07:46:12 -0400 (Thu, 27 Aug 2009)
New Revision: 29092
Modified:
labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java
labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/etc/default-arjuna-properties.xml
labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaJTS/jts/etc/jts.properties_default
Log:
Backported reaper scheduling fixes to the CP branch. JBTM-236 and JBTM-237
Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java 2009-08-27 11:12:57 UTC (rev 29091)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java 2009-08-27 11:46:12 UTC (rev 29092)
@@ -123,12 +123,15 @@
{
if (_dynamic)
{
- try
- {
- final ReaperElement head = (ReaperElement) _transactions.first(); //_list.peak();
- return head._absoluteTimeout - System.currentTimeMillis();
- }
- catch (final NoSuchElementException nsee) {} // fall through
+ try
+ {
+ final ReaperElement head = (ReaperElement) _transactions.first(); //_list.peak();
+ return head._absoluteTimeout - System.currentTimeMillis();
+ }
+ catch (final NoSuchElementException nsee)
+ {
+ return Long.MAX_VALUE; // list is empty, so we can sleep until something is inserted.
+ }
}
return _checkPeriod;
}
@@ -332,41 +335,26 @@
* Ignore if it's already in the list with a different timeout.
* (This should never happen)
*/
- if (_timeouts.containsKey(control)) {
+ if (_timeouts.containsKey(control)) {
return false;
}
- ReaperElement e = new ReaperElement(control, timeout);
+ ReaperElement e = new ReaperElement(control, timeout);
synchronized (this)
{
TransactionReaper._lifetime += timeout;
- /*
- * If the timeout for this transaction is less than the current
- * timeout for the reaper thread (or one is not set for the reaper
- * thread) then use that timeout and interrupt the thread to get it
- * to recheck.
- */
+ _timeouts.put(control, e);
+ boolean rtn = _transactions.add(e);
- final long timeoutms = timeout * 1000;
-
- if (((timeoutms > 0) && (timeoutms < _checkPeriod)) || (_checkPeriod == Long.MAX_VALUE))
+ if(_dynamic)
{
- _checkPeriod = timeoutms; // convert to milliseconds!
- notify();
+ notify(); // force recalc of next wakeup time, taking into account the newly inserted element
}
- }
- /*
- * Can release the lock because the collection is internally synchronized.
- */
-
- synchronized (this)
- {
- _timeouts.put(control, e);
- return _transactions.add(e);
- }
+ return rtn;
+ }
}
public final boolean remove(java.lang.Object control)
Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/etc/default-arjuna-properties.xml
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/etc/default-arjuna-properties.xml 2009-08-27 11:12:57 UTC (rev 29091)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaCore/arjuna/etc/default-arjuna-properties.xml 2009-08-27 11:46:12 UTC (rev 29092)
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
JBoss, Home of Professional Open Source
- Copyright 2006, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags.
See the copyright.txt in the distribution for a
- full listing of individual contributors.
+ full listing of individual contributors.
This copyrighted material is made available to anyone wishing to use,
modify, copy, or redistribute it subject to the terms and conditions
of the GNU Lesser General Public License, v. 2.1.
- This program is distributed in the hope that it will be useful, but WITHOUT A
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ This program is distributed in the hope that it will be useful, but WITHOUT A
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License,
v.2.1 along with this distribution; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
-
+
(C) 2005-2006,
@author JBoss Inc.
-->
@@ -23,7 +23,7 @@
<!--
These options are described in the ArjunaJTS manual.
Defaults are provided here for convenience only.
-
+
Please read through this file prior to using the system, and consider
updating the specified entries.
-->
@@ -32,7 +32,7 @@
xsi:noNamespaceSchemaLocation="transaction-service-2_0.xsd">
<properties name="arjuna" depends="common">
<!--
- Transaction Reaper Timeout (default is 120000 microseconds).
+ Transaction Reaper Timeout (default is 120000 ms).
-->
<property
name="com.arjuna.ats.arjuna.coordinator.txReaperTimeout"
Modified: labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaJTS/jts/etc/jts.properties_default
===================================================================
--- labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaJTS/jts/etc/jts.properties_default 2009-08-27 11:12:57 UTC (rev 29091)
+++ labs/jbosstm/branches/JBOSSTS_4_2_3_GA_CP/ArjunaJTS/jts/etc/jts.properties_default 2009-08-27 11:46:12 UTC (rev 29092)
@@ -1,24 +1,24 @@
#
# JBoss, Home of Professional Open Source
# Copyright 2006, Red Hat Middleware LLC, and individual contributors
-# as indicated by the @author tags.
-# See the copyright.txt in the distribution for a full listing
+# as indicated by the @author tags.
+# See the copyright.txt in the distribution for a full listing
# of individual contributors.
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
# of the GNU General Public License, v. 2.0.
-# This program is distributed in the hope that it will be useful, but WITHOUT A
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# This program is distributed in the hope that it will be useful, but WITHOUT A
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License,
# v. 2.0 along with this distribution; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
-#
+#
# (C) 2005-2006,
# @author JBoss Inc.
#
-#
+#
# Copyright (C) 1999-2001 by HP Bluestone Software, Inc. All rights Reserved.
#
# HP Arjuna Labs,
@@ -37,7 +37,7 @@
# updating the specified entries.
#
-# Transaction Reaper Timeout (default is 120000 microseconds)
+# Transaction Reaper Timeout (default is 120000 ms)
com.arjuna.ats.jts.txReaperTimeout=120000
# Transaction Reaper Mode, can be: NORMAL or DYNAMIC (default is NORMAL)
More information about the jboss-svn-commits
mailing list