Concurrent Modification on executor phases [NullPointerExeption while running relay transport for a long time]

dushan abeyruwan <[email protected]>
Newsgroups gmane.text.xml.axis.user
Message-ID <CA+UxNi_ZC4diAgTHPcOcHN2pwyw7SQmv5nczQji2xB1rM9fpgw@mail.gmail.com>
Hi
  During Apache Synapse Iterator mediator operation for larger message
observed ,while investigating the issue found out its due to  Linked list
modification happens at different phases [1] [2] the problem
has resolved once we introduced *ConcurrentLinkedQueue  instad LinkedQueue
any thoughts on the changers....?*


At the AxisEngine

  [1]   * @throws AxisFault
     */
    private static InvocationResponse invoke(MessageContext msgContext,
boolean resuming)
            throws AxisFault {

        if (msgContext.getCurrentHandlerIndex() == -1) {
            msgContext.setCurrentHandlerIndex(0);
        }

        InvocationResponse pi = InvocationResponse.CONTINUE;

        while (msgContext.getCurrentHandlerIndex() <
msgContext.getExecutionChain().size()) {
            Handler currentHandler = (Handler)
msgContext.getExecutionChain().
                    get(msgContext.getCurrentHandlerIndex());

            try {
                if (!resuming) {
                    msgContext.addExecutedPhase(currentHandler);
                } else {
                    /* If we are resuming the flow, we don't want to add
the phase
                    * again, as it has already been added.
                    */
                    resuming = false;
                }
                pi = currentHandler.invoke(msgContext);
            }

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

    [2].    private static void flowComplete(MessageContext msgContext) {
        Iterator<Handler> invokedPhaseIterator =
msgContext.getExecutedPhases();

        while (invokedPhaseIterator.hasNext()) {
            Handler currentHandler = ((Handler)
invokedPhaseIterator.next());
            currentHandler.flowComplete(msgContext);
        }

        /*This is needed because the OutInAxisOperation currently invokes
        * receive() even when a fault occurs, and we will have already
executed
        * the flowComplete on those before receiveFault() is called.
        */
        msgContext.resetExecutedPhases();
    }


 a


    /**
     * Add a Phase to the collection of executed phases for the path.
     * Phases will be inserted in a LIFO data structure.
     *
     * @param phase The phase to add to the list.
     */
    public void addExecutedPhase(Handler phase) {
        if (executedPhases == null) {
            executedPhases = new LinkedList<Handler>();
        }
        executedPhases.addFirst(phase);
    }

    /**
     * Remove the first Phase in the collection of executed phases
     */
    public void removeFirstExecutedPhase() {
        if (executedPhases != null) {
            executedPhases.removeFirst();
        }
    }

43/carbon/
[2012-11-29 10:55:45,570]  INFO - TimeoutHandler This engine will expire
all callbacks after : 120 seconds, irrespective of the timeout action,
after the specified or optional timeout
Listening for transport dt_socket at address: 8888
[2012-11-29 10:55:48,369] ERROR - NativeWorkerPool Uncaught exception
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at org.apache.axis2.engine.AxisEngine.flowComplete(AxisEngine.java:293)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:182)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2012-11-29 10:55:55,462] ERROR - NativeWorkerPool Uncaught exception
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at org.apache.axis2.engine.AxisEngine.flowComplete(AxisEngine.java:293)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:182)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2012-11-29 10:55:55,484] ERROR - NativeWorkerPool Uncaught exception
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at org.apache.axis2.engine.AxisEngine.flowComplete(AxisEngine.java:293)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:182)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2012-11-29 10:55:56,040] ERROR - NativeWorkerPool Uncaught exception
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at org.apache.axis2.engine.AxisEngine.flowComplete(AxisEngine.java:293)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:182)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
[2012-11-29 10:55:56,263] ERROR - NativeWorkerPool Uncaught exception
java.util.ConcurrentModificationException
at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:761)
at java.util.LinkedList$ListItr.next(LinkedList.java:696)
at org.apache.axis2.engine.AxisEngine.flowComplete(AxisEngine.java:293)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:182)
at
org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:217)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
a



cheers,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.