You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andera Del Bene (JIRA)" <ji...@apache.org> on 2011/07/13 14:35:01 UTC

[jira] [Created] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Possible deadlock running  AsynchronousDataStoreTest
----------------------------------------------------

                 Key: WICKET-3893
                 URL: https://issues.apache.org/jira/browse/WICKET-3893
             Project: Wicket
          Issue Type: Test
          Components: wicket-core
            Reporter: Andera Del Bene


Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
The problem doesn't occur when I decrease EXECUTIONS variable.

A possible fix is to replace latch with a calling to awaitTermination method.

I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-3893.
-------------------------------------

    Resolution: Duplicate

Pedro fixed it with WICKET-3900.

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064543#comment-13064543 ] 

Martin Grigorov commented on WICKET-3893:
-----------------------------------------

I started facing this problem just this morning, and it happened only when I built with bg_BG locale. en_US always worked. The previous days this never blocked. And I build mostly with bg_BG locale...
You fix doesn't solve the problem because it just ignores the uncompleted tasks. See the result of .awaitTermination() - it always returns 'false'.

I tried to improve it but so far the only way to fix it is to restore the previous version of AsynchronousDataStore.

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Andera Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064642#comment-13064642 ] 

Andera Del Bene commented on WICKET-3893:
-----------------------------------------

I've tried with new Locale("bg", "BG") and test still runs good.
In my patch I've completely removed LATCH because if you use awaitTermination you don't need it anymore. 

I think that some runnables doesn't decrement latch because they are submitted twice or more before they are executed.  When this happens the Runnable is executed only once , even if you have submitted it twice or more.
The bigger is EXECUTIONS the more you should note this behavior. 

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Andera Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064729#comment-13064729 ] 

Andera Del Bene commented on WICKET-3893:
-----------------------------------------

Unfortunately  I didn't find much documentation about re-submitting of Runnable already queued inside an Executor :-(

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Andera Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064620#comment-13064620 ] 

Andera Del Bene commented on WICKET-3893:
-----------------------------------------

Hi Martin,

that's quite strange. I've tried my code changing locale (I've also tried 'Locale.setDefault(new Locale("bg_BG"));') and increasing EXECUTIONS up to 1 million without any problem.
awaitTermination always returned 'true'.

Do you think that Locale could affect AsynchronousDataStoreTest execution?

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064543#comment-13064543 ] 

Martin Grigorov edited comment on WICKET-3893 at 7/13/11 1:35 PM:
------------------------------------------------------------------

I started facing this problem just this morning, and it happened only when I built with bg_BG locale. en_US always worked. The previous days this never blocked. And I build mostly with bg_BG locale...
Your fix doesn't solve the problem because it just ignores the uncompleted tasks. See the result of .awaitTermination() - it always returns 'false'.

I tried to improve it but so far the only way to fix it is to restore the previous version of AsynchronousDataStore.

      was (Author: mgrigorov):
    I started facing this problem just this morning, and it happened only when I built with bg_BG locale. en_US always worked. The previous days this never blocked. And I build mostly with bg_BG locale...
You fix doesn't solve the problem because it just ignores the uncompleted tasks. See the result of .awaitTermination() - it always returns 'false'.

I tried to improve it but so far the only way to fix it is to restore the previous version of AsynchronousDataStore.
  
> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Andera Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andera Del Bene updated WICKET-3893:
------------------------------------

    Attachment: AsynchronousTest.patch

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-3893) Possible deadlock running AsynchronousDataStoreTest

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064625#comment-13064625 ] 

Martin Grigorov commented on WICKET-3893:
-----------------------------------------

I don't think so.
By the way the valid way is : new Locale("bg", "BG").

If I move "LATCH.countDown()" before the execution of r() then it passes. But it is incorrect because this way the runnable may not finish its work. As what happens with awaitTermination() when it returns 'false'.

But the question is why some of the runnables doesn't decrement the latch ? If the runnable is rejected then I expect to see thrown RejectedExecutionException's.
It seems AsynchronousDataStore's ThreadPoolExecutor blocks for some reason.

> Possible deadlock running  AsynchronousDataStoreTest
> ----------------------------------------------------
>
>                 Key: WICKET-3893
>                 URL: https://issues.apache.org/jira/browse/WICKET-3893
>             Project: Wicket
>          Issue Type: Test
>          Components: wicket-core
>            Reporter: Andera Del Bene
>         Attachments: AsynchronousTest.patch
>
>
> Running AsynchronousDataStoreTest on "slow" pc (i.e. dual core 2 GhZ, 2 Gb of ram) AsynchronousDataStoreTest doesn't terminate at all. I think that problem occurs when we submit a task which has been already submitted but not executed yet. This leads to a missed latch countdown.
> The problem doesn't occur when I decrease EXECUTIONS variable.
> A possible fix is to replace latch with a calling to awaitTermination method.
> I attach a patch.   

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira