Ok, build issue fix committed, someone wants to spin another release.
I had hoped to have a pre release period to deal with any new bugs,
unfortunately that wasn't a good fit with Apache policy, if we can make
a beta release, then I'm happy with that.
imunit, allows you to control when the interrupt occurs. But I get your
point, remaining users probably aren't greatly affected by the bugs.
Regards,
Peter.
/* Copyright (c) 2010-2012 Zeus Project Services Pty Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.river.concurrent;
import edu.illinois.imunit.Schedules;
import edu.illinois.imunit.Schedule;
import org.junit.Test;
import java.util.concurrent.ConcurrentHashMap;
import org.junit.Before;
import java.util.concurrent.ConcurrentMap;
import edu.illinois.imunit.IMUnitRunner;
import org.junit.runner.RunWith;
import static edu.illinois.imunit.IMUnit.fireEvent;
import static edu.illinois.imunit.IMUnit.schAssertEquals;
import static edu.illinois.imunit.IMUnit.schAssertNull;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
*
* @author Peter Firmstone.
*/
@RunWith(IMUnitRunner.class)
public class ReferenceConcurrentMapConcurrencyTest {
private ConcurrentMap<Integer,String> map;
private ConcurrentMap<Referrer<Integer>,Referrer<String>> internal;
private String t1, t2, t3, t4;
@Before
public void setup() {
internal = new ConcurrentHashMap<Referrer<Integer>,
Referrer<String>>();
map = RC.concurrentMap( internal, Ref.STRONG, Ref.STRONG, 0L, 0L);
t1 = null;
t2 = null;
t3 = null;
t4 = null;
}
@Test
@Schedule("startingPutIfAbsent1->finishPutIfAbsent1,finishPutIfAbsent1->startingPutIfAbsent2,finishPutIfAbsent1->startingPutIfAbsent3")
public void testPut() throws InterruptedException {
System.out.println("test putIfAbsent");
performParallelPutIfAbsent();
assertEquals("Forty-two", map.get(42));
}
@Test
@Schedule("startingPut1->finishPut1,finishPut1->startingClear1,startingClear1->finishClear1,finishClear1->startingPut2,finishClear1->startingPut3,finishClear1->startingPut4")
public void testPutClearPut() throws InterruptedException {
String exp = "Forty-seven";
System.out.println("test put Clear put");
putClearMultiPut();
assertEquals(exp, map.get(new Integer(42)));
assertNull(t1);
boolean success = t2 == null? t3.equals(exp) && t4.equals(exp) :
t3 == null ? t2.equals(exp) && t4.equals(exp):
t4 == null ? t2.equals(t3) && t3.equals(exp): false;
assertTrue(success);
}
private void performParallelPutIfAbsent() throws InterruptedException {
Thread putIfAbsentThread1 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPutIfAbsent1");
map.putIfAbsent(42, "Forty-two");
fireEvent("finishPutIfAbsent1");
}
});
Thread putIfAbsentThread2 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPutIfAbsent2");
map.putIfAbsent(42, "Forty-seven");
fireEvent("finishPutIfAbsent2");
}
});
Thread putIfAbsentThread3 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPutIfAbsent3");
map.putIfAbsent(42, "Fifty-one");
fireEvent("finishPutIfAbsent3");
}
});
putIfAbsentThread1.start();
putIfAbsentThread2.start();
putIfAbsentThread3.start();
putIfAbsentThread1.join();
putIfAbsentThread2.join();
putIfAbsentThread3.join();
}
private void putClearMultiPut() throws InterruptedException {
Thread thread1 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPut1");
t1 = map.putIfAbsent(new Integer(42), "Forty-two");
fireEvent("finishPut1");
}
});
Thread thread2 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPut2");
t2 = map.putIfAbsent(new Integer(42), "Forty-seven");
fireEvent("finishPut2");
}
});
Thread thread3 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPut3");
t3 = map.putIfAbsent(new Integer(42), "Forty-seven");
fireEvent("finishPut3");
}
});
Thread thread4 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingPut4");
t4 = map.putIfAbsent(new Integer(42), "Forty-seven");
fireEvent("finishPut4");
}
});
Thread thread5 = new Thread(new Runnable() {
@Override
public void run() {
fireEvent("startingClear1");
System.out.println("staring clear");
Referrer<String> ref =
internal.get(ReferenceFactory.singleUseForLookup(new Integer(42),
Ref.STRONG));
assertNotNull( ref);
ref.clear();
assertNull( ref.get());
fireEvent("finishClear1");
}
});
thread1.start();
thread2.start();
thread3.start();
thread4.start();
thread5.start();
thread1.join();
thread2.join();
thread3.join();
thread4.join();
thread5.join();
}
}
On 6/03/2016 1:06 AM, Patricia Shanahan wrote:
Meanwhile, I am checking the release policy stuff, with a view to
being able to cast a binding +1 as soon as there is a release
candidate I can compile and test.
I am strongly in favor of getting 3.0 out, but you need to understand
the risk involved, and be prepared for what may happen after the
release. Bugs are not equal, and a reduction in the number of bugs
does not necessarily benefit users.
With software that has been unchanged in the field for an extended
period, every surviving user is either unaffected by each existing
bug, or has a work around for it. A hundred existing bugs that are not
affecting a given user are less of a negative for that user than a
single new bug that does affect them, and for which they do not have a
work around.
For example, at one point I tried to construct a test case for one of
the concurrency bugs. Despite knowing where the bug was, I could not
make it happen. It required an interrupt to hit between two specific
statements, and another thread take just the right action while the
first thread was runnable but not running. It is a bug, and should be
fixed, but it may never happen.
Patricia
On 3/5/2016 4:16 AM, Peter wrote:
Ok, I hadn't realised it was that critical.
In that case, since I hadn't yet posted a binding vote.
+0 Binding.
Regards,
Peter.
On 5/03/2016 9:15 PM, Patricia Shanahan wrote:
The build bug is absolutely critical for the Apache release policy:
"Before voting +1 PMC members are required to download the signed
source code package, compile it as provided, and test the resulting
executable on their own platform, along with also verifying that the
package meets the requirements of the ASF policy on releases."
http://www.apache.org/dev/release.html#approving-a-release
On 3/4/2016 11:00 PM, Peter wrote:
If you want to call it Beta, go for it, lets just get it released,
even
with the build bug, it's not critical.
It won't take long for people to realise this Beta has a few hundred
less bugs than our previous releases, even if some newly introduced
bugs
appear, it'll be easy to fix them quickly.
This is actually a bugfix release, it's just so many bugs got fixed
that
people are frightened of breakages.
The comments on RIVER-431
<https://issues.apache.org/jira/browse/RIVER-431> are really worth
looking at too, there are 241 more bugs reported by Findbugs in River
2.2.1 than River 3.0.0. Our old code is riddled with race conditions,
see for yourself in the comments, the line numbers refer to bugs
present
in River 2.2.1 code. I know which codebase I feel safer using.
http://dl.acm.org/citation.cfm?doid=2414729.2414732
Sub-task
* [RIVER-319 <https://issues.apache.org/jira/browse/RIVER-319>] -
Change River Build Dist structure to support jtreg test
automation
* [RIVER-344 <https://issues.apache.org/jira/browse/RIVER-344>] -
com.sun.jini.thread.TaskManager scalability and concurrency.
Bug
* [RIVER-19 <https://issues.apache.org/jira/browse/RIVER-19>] -
PreferredClassLoader doesn't implement preferred semantics for
getResources(String)
* [RIVER-113 <https://issues.apache.org/jira/browse/RIVER-113>] -
JoinManager synchronization on each proxyReg should be reviewed,
doc'd and fixed where appropriate
* [RIVER-145 <https://issues.apache.org/jira/browse/RIVER-145>] -
JoinManager synchronization on serviceItem should be reviewed,
doc'd and fixed where appropriate
* [RIVER-148 <https://issues.apache.org/jira/browse/RIVER-148>] -
JoinManager.ProxyReg.fail synchronization may be wrong or may be
able to simplify it
* [RIVER-265 <https://issues.apache.org/jira/browse/RIVER-265>] -
PreferredClassProvider performs 'unlucky' caching
* [RIVER-282 <https://issues.apache.org/jira/browse/RIVER-282>] -
Suspect exception cast
* [RIVER-335 <https://issues.apache.org/jira/browse/RIVER-335>] -
com.sun.jini.phoenix.ConstrainableAID missing from phoenix.jar
* [RIVER-337 <https://issues.apache.org/jira/browse/RIVER-337>] -
Attempted discard of unknown registrar kills
LookupLocatorDiscovery thread
* [RIVER-345 <https://issues.apache.org/jira/browse/RIVER-345>] -
SDM LookupCache multi-LUS stale proxy/discard problems
* [RIVER-348 <https://issues.apache.org/jira/browse/RIVER-348>] -
Possible race condition in
net.jini.lookup.ServiceDiscoveryManager
addProxyReg
* [RIVER-367 <https://issues.apache.org/jira/browse/RIVER-367>] -
com.sun.jini.mahalo.TxnManagerImpl fails to abort a Transaction
when notified of its lease expiration.
* [RIVER-387 <https://issues.apache.org/jira/browse/RIVER-387>] -
KerberosServerEndpoint calls com.sun.security methods,
animal-sniffer warns
* [RIVER-395 <https://issues.apache.org/jira/browse/RIVER-395>] -
Ill-behaved DiscoveryListener can terminate discovery notifier
threads
* [RIVER-402 <https://issues.apache.org/jira/browse/RIVER-402>] -
NullPointerException in LookupCacheImpl.notifyServiceMap
* [RIVER-418 <https://issues.apache.org/jira/browse/RIVER-418>] -
Service server implementations start threads before construction
is complete allow "this" to escape
* [RIVER-420 <https://issues.apache.org/jira/browse/RIVER-420>] -
Export during construction.
* [RIVER-422 <https://issues.apache.org/jira/browse/RIVER-422>] -
Missing reference-collections and high-scale-lib in Manifest for
jsk-platform
* [RIVER-431 <https://issues.apache.org/jira/browse/RIVER-431>] -
Java Memory Model Compliance
* [RIVER-433 <https://issues.apache.org/jira/browse/RIVER-433>] -
Test suite freeze while testing service discovery category
Improvement
* [RIVER-26 <https://issues.apache.org/jira/browse/RIVER-26>] -
Make
UmbrellaGrantPermission work with DynamicPolicy
* [RIVER-107 <https://issues.apache.org/jira/browse/RIVER-107>] -
DynamicPolicyProvider could use finer grained locking
* [RIVER-123 <https://issues.apache.org/jira/browse/RIVER-123>] -
ConfigurationFile should support arithmetic operations
* [RIVER-140 <https://issues.apache.org/jira/browse/RIVER-140>] -
JoinManager synchronization strategy should be reviewed,
documented, and fixed where appropriate
* [RIVER-193 <https://issues.apache.org/jira/browse/RIVER-193>] -
support declaring entries in a "common" configuration source for
use in other configuration sources
* [RIVER-249 <https://issues.apache.org/jira/browse/RIVER-249>] -
DynamicPolicy providers do not support UmbrellaGrantPermission
* [RIVER-274 <https://issues.apache.org/jira/browse/RIVER-274>] -
Improve logging of diagnostic messages in
ServiceDiscoveryManager
* [RIVER-343 <https://issues.apache.org/jira/browse/RIVER-343>] -
Private class extends java.lang.Thread, causing synchronization
bottleneck.
* [RIVER-386 <https://issues.apache.org/jira/browse/RIVER-386>] -
Refactor of FastList inside of Outrigger
* [RIVER-401 <https://issues.apache.org/jira/browse/RIVER-401>] -
PreferredClassProvider using URL as key in map
* [RIVER-412 <https://issues.apache.org/jira/browse/RIVER-412>] -
rename com.sun.jini packages to org.apache.river.impl
* [RIVER-439 <https://issues.apache.org/jira/browse/RIVER-439>] -
River only builds on Sun's JVM, add support for other JVM's
New Feature
* [RIVER-313 <https://issues.apache.org/jira/browse/RIVER-313>] -
Provide mechanism to swap in alternatives to Java DSL for
service
configuration
* [RIVER-340 <https://issues.apache.org/jira/browse/RIVER-340>] -
Additional Dynamic Grants and Revokeable Permissions
Question
* [RIVER-365 <https://issues.apache.org/jira/browse/RIVER-365>] -
main build.xml contains remarks about deprecated (and to be
removed) targets, needs clarification
TCK Challenge
* [RIVER-419 <https://issues.apache.org/jira/browse/RIVER-419>] -
ServiceDiscoveryManager lookup qa TCK tests need to be reviewed
Task
* [RIVER-261 <https://issues.apache.org/jira/browse/RIVER-261>] -
update com.sun.* namespace to org.apache.river.*
Test
* [RIVER-304 <https://issues.apache.org/jira/browse/RIVER-304>] -
Reactivate River jtreg tests
On 5/03/2016 2:02 AM, Patricia Shanahan wrote:
My feeling is that there should be some way to document that it is
not
a real release, keep it as a development download for testing only,
but make more users aware of it on those terms.
Can we e.g. put "beta" in its name?
What do other people think?
On 3/4/2016 7:57 AM, Greg Trasuk wrote:
Changing my vote to +0 for the moment.
OK, so what we have here is a build bug.
If you do an ‘ant clean’ then ‘ant river-runtime’, all is good.
Do ‘ant river-runtime’ again, you get the failure that Patricia is
seeing.
If you ‘cd qa’ then do ‘ant run-categories’ the qa suite runs
without
error. That target doesn’t attempt to rebuild the main
distribution. The ‘run’ target inside ‘qa’ _does_ rebuild the main
distribution (I’m not sure why that was put in there, but that’s the
way it’s been forever). Hence it shows the error mentioned above.
When I was doing my testing, I ran ‘ant run-categories’ to run the
test suite, so I didn’t see this build bug.
On the one hand, I’m inclined to cancel the vote, figure out the
bug,
and spin a new release. That could potentially take a while,
because
the bug smells of a nasty circularity in the build (or it could be
trivial).
On the other hand, we did say that this was a “technology preview”
release that is supposed to get 3.0.0 into the hands of potential
users, knowing full well that there are a lot of changes from the
2.2
branch, and people might find operational bugs. People have run the
qa suite, and it the whole package probably works just fine. And
the
licensing is fine. So we could probably just go ahead and
release it.
I’m not sure what to do. Any opinions?
Cheers,
Greg Trasuk.
On Mar 3, 2016, at 4:57 PM, Patricia Shanahan <p...@acm.org> wrote:
The file wk1 in the attached zip is the result of:
pats@pats-acer1:/River_3.0/src/apache-river-3.0.0$ ant clean 2>&1
>wk1
pats@pats-acer1:/River_3.0/src/apache-river-3.0.0$ ant -v 2>&1
>>wk1
On 03/03/2016 09:01 AM, Greg Trasuk wrote:
That’s quite odd. Can you do an ‘ant clean’, then ‘ant -v’ and
post the complete scrollback, from the ‘ant clean’ command, to the
final ‘build failed’?
There is a chance, I suppose, that Ubuntu uses a different version
of Java (i.e. OpenJDK rather than Oracle JDK) or has something
else
pre-installed that is interfering with the build. I haven’t tried
building on Ubuntu myself, but I’m pretty sure I’ve used
OpenJDK at
some point, and it was fine.
Cheers,
Greg Trasuk
On Mar 3, 2016, at 11:35 AM, Patricia Shanahan <p...@acm.org>
wrote:
Tried that. I even went back and re-extracted the .zip file, in
case prior attempts had left tire marks. After the extract I did
ant
ant qa.run
and got the same errors. This is on Ubuntu.
Unfortunately, I cannot cast a binding vote for a release I
cannot
run.
On 3/3/2016 6:20 AM, Greg Trasuk wrote:
Try running just ‘ant’ before you do ‘ant qa.run’. That should
run the default build target.
It appears that ‘qa.run’ is skipping the step where it downloads
the external dependencies. ‘ant’ on its own should do the
build,
then ‘ant qa.run’ should work.
Cheers,
Greg Trasuk
On Mar 2, 2016, at 8:26 PM, Patricia Shanahan <p...@acm.org>
wrote:
I seem to be missing some set-up that needs doing before "ant
qa.run".
ng: Class not found: groovy.lang.MetaMethod
[java] Warning: Class not found:
org.codehaus.groovy.reflection.ClassInfo
[java] Warning: Class not found:
org.codehaus.groovy.runtime.wrappers.Wrapper
[java] Warning: Class not found: groovy.lang.Reference
[java] Warning: Class not found:
org.codehaus.groovy.runtime.callsite.CallSiteArray
[java] Warning: Class not found:
groovy.lang.GroovyCodeSource
[java] Warning: Class not found:
org.codehaus.groovy.runtime.callsite.CallSite
[java] Warning: Class not found:
org.codehaus.groovy.runtime.GeneratedClosure
[java] Warning: Class not found:
org.codehaus.groovy.runtime.typehandling.ShortTypeHandling
[java] Warning: Class not found:
org.codehaus.groovy.runtime.ScriptBytecodeAdapter
[java] Warning: Class not found: groovy.lang.Closure
[java] Warning: Class not found: groovy.lang.MetaClass
[java] Warning: Class not found:
org.cliffc.high_scale_lib.NonBlockingHashMap
[java] Warning: Class not found:
org.codehaus.groovy.runtime.BytecodeInterface8
[java] Warning: Class not found:
org.codehaus.groovy.runtime.ArrayUtil
[java] Warning: Class not found: groovy.lang.GroovyObject
[java] Warning: Class not found:
groovy.lang.GroovyClassLoader
[java] Warning: Class not found:
org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation
[java] Warning: Class not found:
org.codehaus.groovy.control.CompilerConfiguration
[java] Warning: Class not found:
org.codehaus.groovy.runtime.GStringImpl
[java] Warning: Class not found:
groovy.lang.MissingPropertyException
[jar] Building jar:
/River_3.0/src/apache-river-3.0.0/lib/jsk-platform.jar
[java] no text found: "preflistgen.error"
[java] java.lang.NoClassDefFoundError:
org/codehaus/groovy/runtime/GeneratedClosure
[java] at java.lang.ClassLoader.defineClass1(Native
Method)
[java] at
java.lang.ClassLoader.defineClass(ClassLoader.java:800)
[java] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[java] at
java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
[java] at
java.net.URLClassLoader.access$100(URLClassLoader.java:71)
[java] at
java.net.URLClassLoader$1.run(URLClassLoader.java:361)
[java] at
java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[java] at
java.security.AccessController.doPrivileged(Native Method)
[java] at
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[java] at
java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[java] at
java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:278)
[java] at
org.apache.river.tool.PreferredListGen.compute(PreferredListGen.java:1162)
[java] at
org.apache.river.tool.PreferredListGen.main(PreferredListGen.java:1420)
[java] Caused by: java.lang.ClassNotFoundException:
org.codehaus.groovy.runtime.GeneratedClosure
[java] at
java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[java] at
java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[java] at
java.security.AccessController.doPrivileged(Native Method)
[java] at
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[java] at
java.lang.ClassLoader.loadClass(ClassLoader.java:425)
[java] at
java.lang.ClassLoader.loadClass(ClassLoader.java:358)
[java] ... 15 more
BUILD FAILED
/River_3.0/src/apache-river-3.0.0/build.xml:2205: The following
error occurred while executing this line:
/River_3.0/src/apache-river-3.0.0/qa/build.xml:144: The
following error occurred while executing this line:
/River_3.0/src/apache-river-3.0.0/build.xml:973: The following
error occurred while executing this line:
/River_3.0/src/apache-river-3.0.0/common.xml:253: Java
returned: 1
On 03/02/2016 04:20 PM, Peter wrote:
ant qa.run
ant test
Regards,
Peter.
Sent from my Samsung device.
Include original message
---- Original message ----
From: Patricia Shanahan <p...@acm.org>
Sent: 03/03/2016 09:44:57 am
To: dev@river.apache.org
Subject: Re: Reminder: [Vote] Release Apache River JTSK 3.0.0
I have built from the release artifacts, on a Ubuntu box. What
is the
simplest way of running some tests against my build result?
On 3/2/2016 2:25 PM, Patricia Shanahan wrote:
I have just got done with another project that was my
highest priority
for a couple of weeks. I'll attempt to build and test so
that I can cast
a binding vote.
On 3/2/2016 12:12 PM, Greg Trasuk wrote:
Hi folks - we’re still short one binding vote for this
release. So,
if you can, please have a look at the artifacts and have
your say..
Cheers,
Greg Trasuk
On Feb 23, 2016, at 3:43 PM, Greg Trasuk
<tras...@stratuscom.com> wrote:
Hello all:
Release candidate artifacts can be found at
https://dist.apache.org/repos/dist/dev/river/
Binary release artifacts are staged in
https://repository.apache.org/content/repositories/orgapacheriver-1003/
The vote will remain open for at least 72 hours
(Ending no
sooner
than 2100UTC 20160226.
[ ] +1 : I am in favour of this release
[ ] +0 : I am not opposed to this release.
[ ] -1: I am against this release (please provide your
reasons).
Cheers,
Greg Trasuk
<wk1.zip>