Merge lp:~pbeaman/akiban-persistit/java7-issues into lp:akiban-persistit

Proposed by Peter Beaman
Status: Merged
Approved by: Peter Beaman
Approved revision: 414
Merged at revision: 413
Proposed branch: lp:~pbeaman/akiban-persistit/java7-issues
Merge into: lp:akiban-persistit
Diff against target: 86 lines (+8/-10)
3 files modified
src/main/java/com/persistit/Persistit.java (+7/-4)
src/test/java/com/persistit/MediatedFileChannelTest.java (+1/-1)
src/test/java/com/persistit/unit/UnitTestProperties.java (+0/-5)
To merge this branch: bzr merge lp:~pbeaman/akiban-persistit/java7-issues
Reviewer Review Type Date Requested Status
Akiban Build User Needs Fixing
Nathan Williams Approve
Review via email: mp+144285@code.launchpad.net

Description of the change

Fixes a couple of issues that emerged while running unit tests under Java7 on Max OSX.

1. Due to a bug in the OSX version of the JDK, getLocalHost() is either broken or very slow. Since the RMI and JMX services are not used by unit tests, this branch simply removes them from the UnitTestProperties configurations.

2. FileChannel appears to have slightly different behavior when a write is interrupted, possibly leaving the write completed and the ByteBuffer empty. To compensate, MediatedFileChannelTest resets the position of the ByteBuffer.

To post a comment you must log in.
Revision history for this message
Nathan Williams (nwilliams) wrote :

Simple and point 2 sounds important.

review: Approve
Revision history for this message
Akiban Build User (build-akiban) wrote :

There were 2 failures during build/test:

* job server-build failed at build number 3678: http://172.16.20.104:8080/job/server-build/3678/

* view must-pass failed: server-build is yellow

review: Needs Fixing
Revision history for this message
Peter Beaman (pbeaman) wrote :

Seemingly unrelated failure.

Revision history for this message
Akiban Build User (build-akiban) wrote :

There were 2 failures during build/test:

* job server-build failed at build number 3680: http://172.16.20.104:8080/job/server-build/3680/

* view must-pass failed: server-build is yellow

review: Needs Fixing
414. By Peter Beaman

Don't interrupt a thread on close unless it is actually in an active transaction

Revision history for this message
Peter Beaman (pbeaman) wrote :

Server IT tests failed due to threads being unexpectedly interrupted, according to Mike. This update changes Persistit#interruptActiveThreads to interrupt only those threads engaged in active transactions, per Mike's request.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/main/java/com/persistit/Persistit.java'
--- src/main/java/com/persistit/Persistit.java 2012-12-31 01:47:18 +0000
+++ src/main/java/com/persistit/Persistit.java 2013-01-23 19:49:22 +0000
@@ -37,6 +37,7 @@
37import java.util.Iterator;37import java.util.Iterator;
38import java.util.List;38import java.util.List;
39import java.util.Map;39import java.util.Map;
40import java.util.Map.Entry;
40import java.util.Properties;41import java.util.Properties;
41import java.util.Set;42import java.util.Set;
42import java.util.TreeMap;43import java.util.TreeMap;
@@ -1699,12 +1700,14 @@
1699 final long expires = System.currentTimeMillis() + timeout;1700 final long expires = System.currentTimeMillis() + timeout;
1700 boolean remaining = false;1701 boolean remaining = false;
1701 do {1702 do {
1702 final Set<SessionId> sessionIds;1703 final Map<SessionId, Transaction> copy;
1703 synchronized (_transactionSessionMap) {1704 synchronized (_transactionSessionMap) {
1704 sessionIds = new HashSet<SessionId>(_transactionSessionMap.keySet());1705 copy = new HashMap<SessionId, Transaction>(_transactionSessionMap);
1705 }1706 }
1706 for (final SessionId sessionId : sessionIds) {1707 for (final Entry<SessionId, Transaction> entry : copy.entrySet()) {
1707 if (sessionId.isAlive()) {1708 final SessionId sessionId = entry.getKey();
1709 final Transaction txn = entry.getValue();
1710 if (sessionId.isAlive() && txn.isActive() ) {
1708 if (sessionId.interrupt()) {1711 if (sessionId.interrupt()) {
1709 _logBase.interruptedAtClose.log(sessionId.ownerName());1712 _logBase.interruptedAtClose.log(sessionId.ownerName());
1710 }1713 }
17111714
=== modified file 'src/test/java/com/persistit/MediatedFileChannelTest.java'
--- src/test/java/com/persistit/MediatedFileChannelTest.java 2012-08-24 13:57:19 +0000
+++ src/test/java/com/persistit/MediatedFileChannelTest.java 2013-01-23 19:49:22 +0000
@@ -84,7 +84,6 @@
84 for (int i = 0; i < 65536; i++) {84 for (int i = 0; i < 65536; i++) {
85 bb.array()[i] = (byte) (i % 32 + 64);85 bb.array()[i] = (byte) (i % 32 + 64);
86 }86 }
87
88 final long start = System.nanoTime();87 final long start = System.nanoTime();
89 while (errors == 0 && System.nanoTime() - start < TIME) {88 while (errors == 0 && System.nanoTime() - start < TIME) {
90 try {89 try {
@@ -94,6 +93,7 @@
94 fc.force(true);93 fc.force(true);
95 count++;94 count++;
96 } catch (final InterruptedIOException e) {95 } catch (final InterruptedIOException e) {
96 bb.position(0);
97 // ignore -- expected97 // ignore -- expected
98 interrupts++;98 interrupts++;
99 // need to clear the interrupted status99 // need to clear the interrupted status
100100
=== modified file 'src/test/java/com/persistit/unit/UnitTestProperties.java'
--- src/test/java/com/persistit/unit/UnitTestProperties.java 2012-08-10 16:18:11 +0000
+++ src/test/java/com/persistit/unit/UnitTestProperties.java 2013-01-23 19:49:22 +0000
@@ -41,7 +41,6 @@
41 p.setProperty("journalpath", "${datapath}/persistit_journal");41 p.setProperty("journalpath", "${datapath}/persistit_journal");
42 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");42 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
43 p.setProperty("tmpvoldir", "${datapath}");43 p.setProperty("tmpvoldir", "${datapath}");
44 p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
45 p.setProperty("jmx", "true");44 p.setProperty("jmx", "true");
46 return p;45 return p;
47 }46 }
@@ -62,7 +61,6 @@
62 p.setProperty("journalpath", "${datapath}/persistit_journal");61 p.setProperty("journalpath", "${datapath}/persistit_journal");
63 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");62 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
64 p.setProperty("tmpvoldir", "${datapath}");63 p.setProperty("tmpvoldir", "${datapath}");
65 p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
66 return p;64 return p;
67 }65 }
6866
@@ -78,7 +76,6 @@
78 p.setProperty("journalpath", "${datapath}/persistit_alt_journal");76 p.setProperty("journalpath", "${datapath}/persistit_alt_journal");
79 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");77 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
80 p.setProperty("tmpvoldir", "${datapath}");78 p.setProperty("tmpvoldir", "${datapath}");
81 p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
82 return p;79 return p;
83 }80 }
8481
@@ -94,8 +91,6 @@
94 p.setProperty("journalpath", "${datapath}/persistit_journal");91 p.setProperty("journalpath", "${datapath}/persistit_journal");
95 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");92 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
96 p.setProperty("tmpvoldir", "${datapath}");93 p.setProperty("tmpvoldir", "${datapath}");
97 p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
98 p.setProperty("jmx", "true");
99 return p;94 return p;
100 }95 }
10196

Subscribers

People subscribed via source and target branches