Two emails are worth reflecting on, as is River-344, this relates to replacing TaskManager with ExecutorService.

http://mail-archives.apache.org/mod_mbox/river-dev/201107.mbox/%3cbb4ad312-53c1-4ce6-9bff-01e5cc344...@sorcersoft.org%3e
http://mail-archives.apache.org/mod_mbox/river-dev/201105.mbox/%3c4dc17d85.5000...@acm.org%3e

TaskManager.Task.runAfter was slowly being eliminated by the original Jini team and has been a hot topic of discussion since Patricia began analysing its use.

One of the problems we have developing River, is a lack of access to big iron hardware, for this reason I've made no attempt to optimise any implementations.

The work I've done so far:

  1. Used time and sequence numbers and Comparable to allow ordering of
     tasks where necessary, the ExecutorServices for these will remain
     separate, so that comparable tasks are not mixed to replace
     Task.runAfter functionality
  2. Allowed users to implement their own ExecutorService
     implementations, to be optimised on their own hardware, since we
     are unable to.
  3. Used ThreadPoolExecutor with the same number of pool threads as
     specified for TaskManager, in a number of instances, because many
     queues are unbounded, corePoolthreads is set to the max threads
     setting of the TaskManager it replaces.  This is probably sub
     optimal as threads are not created on demand, they ramp up to
     corePoolthreads under relatively light load.


The following test is supposed to test compliance with the Jini specifications, however I can't find anywhere in the specification where services that are registered first, should have their events prioritised over services registered immediately after:

com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td

Wouldn't it be more reasonable to expect that each ServiceEvent should arrive in order for each ServiceID, without regard for the order that the services (ServiceID's) themselves are registered?

Thoughts?

Regards,

Peter.

/** Executes the current QA test.
     *
* For each service instance created during construct, deletes the attribute
     *  belonging to that service by modifying the attribute with the
     *  the corresponding null attribute from the second set. Waits a
     *  configured amount of time to allow for all of the events to be
* generated and collected. Determines if all of the expected -- as well
     *  as no un-expected -- events have arrived. This test depends on the
     *  semantics of event-notification. That is, it uses the fact that
     *  if the events were generated for each service item in sequence
* (which they were), then the events will arrive in that same sequence.
     *  This means one can expect, when examining the event corresponding
* to index i, that the service ID returned in the ServiceEvent should * correspond to the i_th service item registered. If it does not, then * failure is declared. Thus, this test does the following: 1. Verifies * that the number of expected events equals the number of events that
     *  have arrived. 2. Verifies that the transition returned in event[i]
     *  corresponds to the expected transition (MATCH_MATCH). 3. Verifies
     *  that the service ID returned in event[i] equals the service ID
     *  of the i_th service registered. 4. Verifies that the handback
     *  returned in the i_th event object equals the service ID of the
     *  i_th service.
     */

-----------------------------------------


Running com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
Running com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
Time is Mon Jan 13 21:04:08 EST 2014
Time is Mon Jan 13 21:04:08 EST 2014
Starting test in separate process with command:
Starting test in separate process with command:
'C:\Program Files\Java\jdk1.7.0_45\jre\bin\java' -Djava.security.manager=org.apache.river.api.security.CombinerSecurityManager -Djava.security.policy=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/harness/policy/defaulttest.policy -Djava.rmi.server.codebase=http://medusa:9082/qa1-lookupservice-dl.jar -cp C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jiniharness.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jinitests.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\jsk-platform.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\jsk-lib.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\high-scale-lib.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\custard-apple-1.0.3.jar -ea -esa '-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_45\jre\lib\ext;C:\windows\Sun\Java\lib\ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib-ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-ext' -Dcom.sun.jini.jsk.port=9080 -Dcom.sun.jini.qa.port=9081 -Dcom.sun.jini.jsk.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy -Dcom.sun.jini.qa.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa -Dcom.sun.jini.qa.harness.harnessJar=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jiniharness.jar -Dcom.sun.jini.qa.harness.testJar=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jinitests.jar -Dcom.sun.jini.qa.harness.runjiniserver=true -Dcom.sun.jini.qa.harness.runkitserver=true -Djava.security.properties=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/harness/trust/dynamic-policy.properties -Dcom.sun.jini.qa.harness.testhosts= -Djava.util.logging.config.file=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\src\com\sun\jini\test\resources\qa1.logging -Djava.rmi.server.useCodebaseOnly=false -Dcom.sun.jini.test.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa -Dcom.sun.jini.test.port=9082 -Dcom.sun.jini.qa.harness.policies=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/src/com/sun/jini/test/resources/jinitest.policy '-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_45\jre\lib\ext;C:\windows\Sun\Java\lib\ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib-ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-ext' -Dcom.sun.jini.test.spec.lookupservice.deltaTListener=20 com.sun.jini.qa.harness.MasterTest com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td 'C:\Program Files\Java\jdk1.7.0_45\jre\bin\java' -Djava.security.manager=org.apache.river.api.security.CombinerSecurityManager -Djava.security.policy=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/harness/policy/defaulttest.policy -Djava.rmi.server.codebase=http://medusa:9082/qa1-lookupservice-dl.jar -cp C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jiniharness.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jinitests.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\jsk-platform.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\jsk-lib.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\high-scale-lib.jar;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib\custard-apple-1.0.3.jar -ea -esa '-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_45\jre\lib\ext;C:\windows\Sun\Java\lib\ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib-ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-ext' -Dcom.sun.jini.jsk.port=9080 -Dcom.sun.jini.qa.port=9081 -Dcom.sun.jini.jsk.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy -Dcom.sun.jini.qa.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa -Dcom.sun.jini.qa.harness.harnessJar=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jiniharness.jar -Dcom.sun.jini.qa.harness.testJar=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\jinitests.jar -Dcom.sun.jini.qa.harness.runjiniserver=true -Dcom.sun.jini.qa.harness.runkitserver=true -Djava.security.properties=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/harness/trust/dynamic-policy.properties -Dcom.sun.jini.qa.harness.testhosts= -Djava.util.logging.config.file=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\src\com\sun\jini\test\resources\qa1.logging -Djava.rmi.server.useCodebaseOnly=false -Dcom.sun.jini.test.home=C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa -Dcom.sun.jini.test.port=9082 -Dcom.sun.jini.qa.harness.policies=file:/C:/Users/peter/Documents/NetBeansProjects/peterConcurrentPolicy/qa/src/com/sun/jini/test/resources/jinitest.policy '-Djava.ext.dirs=C:\Program Files\Java\jdk1.7.0_45\jre\lib\ext;C:\windows\Sun\Java\lib\ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib-ext;C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-ext' -Dcom.sun.jini.test.spec.lookupservice.deltaTListener=20 com.sun.jini.qa.harness.MasterTest com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td


TIME: 9:04:09 PM
TIME: 9:04:09 PM


MasterTest.doTest INFO:
MasterTest.doTest INFO:
============================== CALLING CONSTRUCT() ============================== ============================== CALLING CONSTRUCT() ==============================


Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\], port 9081] INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\], port 9081]
Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-dl\], port 9080] INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\lib-dl\], port 9080]
Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
Jan 13, 2014 9:04:09 PM com.sun.jini.tool.ClassServer run
INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\], port 9082] INFO: ClassServer started [[C:\Users\peter\Documents\NetBeansProjects\peterConcurrentPolicy\qa\lib\], port 9082]
MasterTest.doTest INFO:
MasterTest.doTest INFO:
=============================== CALLING RUN() =============================== =============================== CALLING RUN() ===============================


com.sun.jini.qa.harness.TestException: Service ID Received (42829cfc-5ac2-4845-927c-6a8f7666746b) != Service ID Expected (f8e93898-22e1-46e8-bb23-d22329601e3f) com.sun.jini.qa.harness.TestException: Service ID Received (42829cfc-5ac2-4845-927c-6a8f7666746b) != Service ID Expected (f8e93898-22e1-46e8-bb23-d22329601e3f) at com.sun.jini.test.spec.lookupservice.QATestUtils.verifyEventVector(QATestUtils.java:504) at com.sun.jini.test.spec.lookupservice.test_set00.NotifyOnAttrAdd.run(NotifyOnAttrAdd.java:187)
    at com.sun.jini.qa.harness.MasterTest.doTest(MasterTest.java:256)
    at com.sun.jini.qa.harness.MasterTest.main(MasterTest.java:144)


TIME: 9:04:35 PM
TIME: 9:04:35 PM


MasterTest.doTest INFO:
MasterTest.doTest INFO:
============================ CALLING TEARDOWN() ============================= ============================ CALLING TEARDOWN() =============================


Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
INFO: ClassServer terminated [port 9082]
INFO: ClassServer terminated [port 9082]
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
INFO: ClassServer terminated [port 9082]
INFO: ClassServer terminated [port 9082]
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
INFO: ClassServer terminated [port 9081]
INFO: ClassServer terminated [port 9081]
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
INFO: ClassServer terminated [port 9080]
INFO: ClassServer terminated [port 9080]
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
Jan 13, 2014 9:04:37 PM com.sun.jini.tool.ClassServer terminate
INFO: ClassServer terminated [port 9080]
INFO: ClassServer terminated [port 9080]


TIME: 9:04:37 PM
TIME: 9:04:37 PM


Test process was destroyed and returned code 1
Test process was destroyed and returned code 1
com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
com/sun/jini/test/spec/lookupservice/test_set00/NotifyOnAttrAdd.td
Test Failed: Test Failed: com.sun.jini.qa.harness.TestException: Service ID Received (42829cfc-5ac2-4845-927c-6a8f7666746b) != Service ID Expected (f8e93898-22e1-46e8-bb23-d22329601e3f) Test Failed: Test Failed: com.sun.jini.qa.harness.TestException: Service ID Received (42829cfc-5ac2-4845-927c-6a8f7666746b) != Service ID Expected (f8e93898-22e1-46e8-bb23-d22329601e3f)




-----------------------------------------

Reply via email to