db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r1133317 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
Date Wed, 08 Jun 2011 09:50:23 GMT
Author: kristwaa
Date: Wed Jun  8 09:50:23 2011
New Revision: 1133317

URL: http://svn.apache.org/viewvc?rev=1133317&view=rev
Log:
DERBY-5108: Intermittent failure in AutomaticIndexStatisticsTest.testShutdownWhileScanningThenDelete
on Windows 

Adjust the istat log message if the scan is aborted.

Patch file: derby-5108-3a-istat_log_abort.diff


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java?rev=1133317&r1=1133316&r2=1133317&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/IndexStatisticsDaemonImpl.java
Wed Jun  8 09:50:23 2011
@@ -1032,9 +1032,15 @@ public class IndexStatisticsDaemonImpl
         // timings[x] = [conglomId, start, end]
         StringBuffer sb = new StringBuffer("scan durations (");
         for (int i=0; i < timings.length && timings[i][0] > 0; i++) {
-            long duration = timings[i][2] - timings[i][1];
-            sb.append('c').append(timings[i][0]).append('=').append(duration).
-                    append("ms,");
+            sb.append('c').append(timings[i][0]).append('=');
+            // Handle corner-case where the scans are aborted due to the
+            // index statistics daemon being shut down under us.
+            if (timings[i][2] == 0) {
+                sb.append("ABORTED,");   
+            } else {
+                long duration = timings[i][2] - timings[i][1];
+                sb.append(duration).append("ms,");
+            }
         }
         sb.deleteCharAt(sb.length() -1).append(")");
         return sb.toString();



Mime
View raw message