Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv10159/src/java/org/logicalcobwebs/proxool/admin
Modified Files:
StatsRoller.java
Log Message:
roll() now makes an additional call to isCurrent() *before* it asks for a write lock. Before it
was getting a write lock every five seconds which effectively blocks all connections (if only briefly).
Index: StatsRoller.java
===================================================================
RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/StatsRoller.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** StatsRoller.java 10 Sep 2003 22:21:04 -0000 1.7
--- StatsRoller.java 27 Oct 2003 20:24:48 -0000 1.8
***************
*** 114,130 ****
private void roll() {
! try {
! readWriteLock.writeLock().acquire();
! if (!isCurrent()) {
! currentStatistics.setStopDate(nextRollDate.getTime());
! completeStatistics = currentStatistics;
! currentStatistics = new Statistics(nextRollDate.getTime());
! nextRollDate.add(units, period);
! compositeStatisticsListener.statistics(alias, completeStatistics);
}
- } catch (InterruptedException e) {
- LOG.error("Unable to roll statistics log", e);
- } finally {
- readWriteLock.writeLock().release();
}
}
--- 114,132 ----
private void roll() {
! if (!isCurrent()) {
! try {
! readWriteLock.writeLock().acquire();
! if (!isCurrent()) {
! currentStatistics.setStopDate(nextRollDate.getTime());
! completeStatistics = currentStatistics;
! currentStatistics = new Statistics(nextRollDate.getTime());
! nextRollDate.add(units, period);
! compositeStatisticsListener.statistics(alias, completeStatistics);
! }
! } catch (Throwable e) {
! LOG.error("Unable to roll statistics log", e);
! } finally {
! readWriteLock.writeLock().release();
}
}
}
***************
*** 138,144 ****
*/
public void connectionReturned(long activeTime) {
! if (!isCurrent()) {
! roll();
! }
try {
readWriteLock.readLock().acquire();
--- 140,144 ----
*/
public void connectionReturned(long activeTime) {
! roll();
try {
readWriteLock.readLock().acquire();
***************
*** 155,161 ****
*/
public void connectionRefused() {
! if (!isCurrent()) {
! roll();
! }
try {
readWriteLock.readLock().acquire();
--- 155,159 ----
*/
public void connectionRefused() {
! roll();
try {
readWriteLock.readLock().acquire();
***************
*** 189,192 ****
--- 187,194 ----
Revision history:
$Log$
+ Revision 1.8 2003/10/27 20:24:48 billhorsman
+ roll() now makes an additional call to isCurrent() *before* it asks for a write lock. Before it
+ was getting a write lock every five seconds which effectively blocks all connections (if only briefly).
+
Revision 1.7 2003/09/10 22:21:04 chr32
Removing > jdk 1.2 dependencies.
|