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
1=== modified file 'src/main/java/com/persistit/Persistit.java'
2--- src/main/java/com/persistit/Persistit.java 2012-12-31 01:47:18 +0000
3+++ src/main/java/com/persistit/Persistit.java 2013-01-23 19:49:22 +0000
4@@ -37,6 +37,7 @@
5 import java.util.Iterator;
6 import java.util.List;
7 import java.util.Map;
8+import java.util.Map.Entry;
9 import java.util.Properties;
10 import java.util.Set;
11 import java.util.TreeMap;
12@@ -1699,12 +1700,14 @@
13 final long expires = System.currentTimeMillis() + timeout;
14 boolean remaining = false;
15 do {
16- final Set<SessionId> sessionIds;
17+ final Map<SessionId, Transaction> copy;
18 synchronized (_transactionSessionMap) {
19- sessionIds = new HashSet<SessionId>(_transactionSessionMap.keySet());
20+ copy = new HashMap<SessionId, Transaction>(_transactionSessionMap);
21 }
22- for (final SessionId sessionId : sessionIds) {
23- if (sessionId.isAlive()) {
24+ for (final Entry<SessionId, Transaction> entry : copy.entrySet()) {
25+ final SessionId sessionId = entry.getKey();
26+ final Transaction txn = entry.getValue();
27+ if (sessionId.isAlive() && txn.isActive() ) {
28 if (sessionId.interrupt()) {
29 _logBase.interruptedAtClose.log(sessionId.ownerName());
30 }
31
32=== modified file 'src/test/java/com/persistit/MediatedFileChannelTest.java'
33--- src/test/java/com/persistit/MediatedFileChannelTest.java 2012-08-24 13:57:19 +0000
34+++ src/test/java/com/persistit/MediatedFileChannelTest.java 2013-01-23 19:49:22 +0000
35@@ -84,7 +84,6 @@
36 for (int i = 0; i < 65536; i++) {
37 bb.array()[i] = (byte) (i % 32 + 64);
38 }
39-
40 final long start = System.nanoTime();
41 while (errors == 0 && System.nanoTime() - start < TIME) {
42 try {
43@@ -94,6 +93,7 @@
44 fc.force(true);
45 count++;
46 } catch (final InterruptedIOException e) {
47+ bb.position(0);
48 // ignore -- expected
49 interrupts++;
50 // need to clear the interrupted status
51
52=== modified file 'src/test/java/com/persistit/unit/UnitTestProperties.java'
53--- src/test/java/com/persistit/unit/UnitTestProperties.java 2012-08-10 16:18:11 +0000
54+++ src/test/java/com/persistit/unit/UnitTestProperties.java 2013-01-23 19:49:22 +0000
55@@ -41,7 +41,6 @@
56 p.setProperty("journalpath", "${datapath}/persistit_journal");
57 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
58 p.setProperty("tmpvoldir", "${datapath}");
59- p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
60 p.setProperty("jmx", "true");
61 return p;
62 }
63@@ -62,7 +61,6 @@
64 p.setProperty("journalpath", "${datapath}/persistit_journal");
65 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
66 p.setProperty("tmpvoldir", "${datapath}");
67- p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
68 return p;
69 }
70
71@@ -78,7 +76,6 @@
72 p.setProperty("journalpath", "${datapath}/persistit_alt_journal");
73 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
74 p.setProperty("tmpvoldir", "${datapath}");
75- p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
76 return p;
77 }
78
79@@ -94,8 +91,6 @@
80 p.setProperty("journalpath", "${datapath}/persistit_journal");
81 p.setProperty("logfile", "${datapath}/persistit_${timestamp}.log");
82 p.setProperty("tmpvoldir", "${datapath}");
83- p.setProperty("rmiport", System.getProperty("rmiport", "8081"));
84- p.setProperty("jmx", "true");
85 return p;
86 }
87

Subscribers

People subscribed via source and target branches