You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ace.apache.org by ja...@apache.org on 2014/02/25 16:07:11 UTC
svn commit: r1571717 - in /ace/trunk/org.apache.ace.log:
src/org/apache/ace/log/server/store/impl/LogStoreImpl.java
test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java
Author: jawi
Date: Tue Feb 25 15:07:11 2014
New Revision: 1571717
URL: http://svn.apache.org/r1571717
Log:
ACE-461 - minor updates to make test a little more robust.
Modified:
ace/trunk/org.apache.ace.log/src/org/apache/ace/log/server/store/impl/LogStoreImpl.java
ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java
Modified: ace/trunk/org.apache.ace.log/src/org/apache/ace/log/server/store/impl/LogStoreImpl.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log/src/org/apache/ace/log/server/store/impl/LogStoreImpl.java?rev=1571717&r1=1571716&r2=1571717&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log/src/org/apache/ace/log/server/store/impl/LogStoreImpl.java (original)
+++ ace/trunk/org.apache.ace.log/src/org/apache/ace/log/server/store/impl/LogStoreImpl.java Tue Feb 25 15:07:11 2014
@@ -456,7 +456,14 @@ public class LogStoreImpl implements Log
if (alreadyLocked) {
int nrOfTries = 0;
while (alreadyLocked && nrOfTries++ < 10000) {
- LockSupport.parkNanos(50);
+ try {
+ Thread.sleep(1);
+ }
+ catch (InterruptedException exception) {
+ // Restore interrupted flag...
+ Thread.currentThread().interrupt();
+ break;
+ }
synchronized (lockedLogs) {
alreadyLocked = lockedLogs.contains(logID);
Modified: ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java
URL: http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java?rev=1571717&r1=1571716&r2=1571717&view=diff
==============================================================================
--- ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java (original)
+++ ace/trunk/org.apache.ace.log/test/org/apache/ace/log/server/store/impl/LogStoreImplConcurrencyTest.java Tue Feb 25 15:07:11 2014
@@ -153,8 +153,13 @@ public class LogStoreImplConcurrencyTest
long id = i;
Event event = new Event(TARGET_ID, STORE_ID, id, id, rnd.nextInt(10));
- m_store.put(Arrays.asList(event));
- m_written.putIfAbsent(Long.valueOf(id), event);
+ try {
+ m_store.put(Arrays.asList(event));
+ m_written.putIfAbsent(Long.valueOf(id), event);
+ }
+ catch (Exception exception) {
+ // Ignore...
+ }
}
System.out.printf("Writer (%s) finished with %d records written...%n", m_name, m_written.size());
@@ -162,12 +167,9 @@ public class LogStoreImplConcurrencyTest
catch (InterruptedException e) {
// ok, stop...
}
- catch (IOException exception) {
- exception.printStackTrace();
- }
finally {
m_stop.countDown();
-
+
System.out.println("Ending writer (" + m_name + ")");
}
}