You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Dawid Weiss (JIRA)" <ji...@apache.org> on 2013/05/08 15:15:16 UTC

[jira] [Created] (LUCENE-4987) Test framework may fail internally under J9 (some serious JVM exclusive-section issue).

Dawid Weiss created LUCENE-4987:
-----------------------------------

             Summary: Test framework may fail internally under J9 (some serious JVM exclusive-section issue).
                 Key: LUCENE-4987
                 URL: https://issues.apache.org/jira/browse/LUCENE-4987
             Project: Lucene - Core
          Issue Type: Bug
            Reporter: Dawid Weiss
            Assignee: Dawid Weiss
            Priority: Minor


This was reported by Shai. The runner failed with an exception:
{code}
[junit4:junit4] Caused by: java.util.NoSuchElementException
[junit4:junit4]         at java.util.ArrayDeque.removeFirst(ArrayDeque.java:289)
[junit4:junit4]         at java.util.ArrayDeque.pop(ArrayDeque.java:518)
[junit4:junit4]         at com.carrotsearch.ant.tasks.junit4.JUnit4$1.onSlaveIdle(JUnit4.java:809)
[junit4:junit4]         ... 17 more
{code}

The problem is that this is impossible because the code around JUnit4.java:809 looks like this:

{code}
     final Deque<String> stealingQueue = new ArrayDeque<String>(...);
     aggregatedBus.register(new Object() {
        @Subscribe
        public void onSlaveIdle(SlaveIdle slave) {
          if (stealingQueue.isEmpty()) {
            ...
          } else {
            String suiteName = stealingQueue.pop();
            ...
          }
        }
      });
{code}

and the contract on Guava's EventBus states that:

{code}
 * <p>The EventBus guarantees that it will not call a handler method from
 * multiple threads simultaneously, unless the method explicitly allows it by
 * bearing the {@link AllowConcurrentEvents} annotation.  If this annotation is
 * not present, handler methods need not worry about being reentrant, unless
 * also called from outside the EventBus
{code}

I wrote a simple snippet of code that does it in a loop and indeed, two threads can appear in the critical section at once. This is not reproducible on Hotspot and only appears to be the problem on J9/1.7/Windows (J9 1.6 works fine).

I'll provide a workaround in the runner (an explicit monitor seems to be working) but this is some serious J9 issue.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org