activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <>
Subject [jira] Updated: (AMQ-1686) Small window in wakeup logic for PooledTaskRunner - task can get executed in parallell
Date Thu, 24 Apr 2008 16:32:43 GMT


Gary Tully updated AMQ-1686:

    Attachment: AMQ-1689.patch

the test case inclued does not actually reproduce the problem, it comes close but the window
to check paralell access is too small. Maybe someone else can improve on it.

> Small window in wakeup logic for PooledTaskRunner - task can get executed in parallell
> --------------------------------------------------------------------------------------
>                 Key: AMQ-1686
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.0.0
>         Environment: windows XP
>            Reporter: Gary Tully
>         Attachments: AMQ-1689.patch
> fails on windows sometimes
with the error:
> Exception in thread "Persistence Adaptor Task" java.lang.NullPointerException
>         at$4.execute(
>         at
>         at
>         at
>         at$1.iterate(
>         at org.apache.activemq.thread.PooledTaskRunner.runTask(
>         at org.apache.activemq.thread.PooledTaskRunner$
>         at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>         at java.util.concurrent.ThreadPoolExecutor$
>         at
> Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 303.672 sec <<<
> The problem appears to be in the interaction between wakup and runTask in PooledTaskRunner
> iterating is set to false in a finally  and queued is checked in a separate sync block.
> if wakeup is called in this window, it can set queued and find iterating false so it
will execute, and runTask will find queued true and it too will execute.
> the fix is to include the queued check in the finally block so that iterating and queued
are checked at the same time. I will attach a patch with this fix.
> I attempted to reproduce this problem with a unit test but I did not have any real success.
the window is quite small. I will include the unit test in case it can be improved upon.
> chirino merged a fix yesterday that addresses the symptom of this issue in a different
> The added synchronisation means that parallel calls by the PooledTaskRunner.asyncWrite
are serialised on the method access.
> This fix addresses the route cause and can negate the need for the synchronisation.
> fyi: In the test, the paralell calls can come from flush() and from the asyncWrite task.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message