You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2010/07/02 15:34:49 UTC

[jira] Created: (SLING-1581) Concurrent session access in event handlers

Concurrent session access in event handlers
-------------------------------------------

                 Key: SLING-1581
                 URL: https://issues.apache.org/jira/browse/SLING-1581
             Project: Sling
          Issue Type: Bug
          Components: Extensions
    Affects Versions: Extensions Event 2.3.0
            Reporter: Jukka Zitting


I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().

There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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


[jira] Assigned: (SLING-1581) Concurrent session access in event handlers

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

Carsten Ziegeler reassigned SLING-1581:
---------------------------------------

    Assignee: Carsten Ziegeler

> Concurrent session access in event handlers
> -------------------------------------------
>
>                 Key: SLING-1581
>                 URL: https://issues.apache.org/jira/browse/SLING-1581
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Event 2.3.0
>            Reporter: Jukka Zitting
>            Assignee: Carsten Ziegeler
>             Fix For: Extensions Event 2.4.0
>
>         Attachments: SLING-1581.patch
>
>
> I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().
> There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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


[jira] Closed: (SLING-1581) Concurrent session access in event handlers

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

Carsten Ziegeler closed SLING-1581.
-----------------------------------


> Concurrent session access in event handlers
> -------------------------------------------
>
>                 Key: SLING-1581
>                 URL: https://issues.apache.org/jira/browse/SLING-1581
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Event 2.3.0
>            Reporter: Jukka Zitting
>            Assignee: Carsten Ziegeler
>             Fix For: Extensions Event 2.4.0
>
>         Attachments: SLING-1581.patch
>
>
> I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().
> There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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


[jira] Resolved: (SLING-1581) Concurrent session access in event handlers

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

Carsten Ziegeler resolved SLING-1581.
-------------------------------------

    Resolution: Fixed

I've applied a slightly modified patch in revisions 960613 and 960616:
- the writeLock moved to the AbstractRepositoryEventHandler
- startWriterSession and stopWriterSession are called inside a sync block

This should solve the problem - the DistributingEventHandler does not need additional syncing as there is only one write operation and this is done in a queue by a single thread.
The two other handlers already use the sync lock

> Concurrent session access in event handlers
> -------------------------------------------
>
>                 Key: SLING-1581
>                 URL: https://issues.apache.org/jira/browse/SLING-1581
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Event 2.3.0
>            Reporter: Jukka Zitting
>            Assignee: Carsten Ziegeler
>             Fix For: Extensions Event 2.4.0
>
>         Attachments: SLING-1581.patch
>
>
> I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().
> There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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


[jira] Updated: (SLING-1581) Concurrent session access in event handlers

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

Jukka Zitting updated SLING-1581:
---------------------------------

    Attachment: SLING-1581.patch

The proposed patch moves the writeLock object to the base class and uses it to synchronize more of the potentially concurrent session accesses.

> Concurrent session access in event handlers
> -------------------------------------------
>
>                 Key: SLING-1581
>                 URL: https://issues.apache.org/jira/browse/SLING-1581
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Event 2.3.0
>            Reporter: Jukka Zitting
>         Attachments: SLING-1581.patch
>
>
> I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().
> There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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


[jira] Updated: (SLING-1581) Concurrent session access in event handlers

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

Carsten Ziegeler updated SLING-1581:
------------------------------------

    Fix Version/s: Extensions Event 2.4.0

> Concurrent session access in event handlers
> -------------------------------------------
>
>                 Key: SLING-1581
>                 URL: https://issues.apache.org/jira/browse/SLING-1581
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Extensions Event 2.3.0
>            Reporter: Jukka Zitting
>            Assignee: Carsten Ziegeler
>             Fix For: Extensions Event 2.4.0
>
>         Attachments: SLING-1581.patch
>
>
> I have a deadlock scenario caused by one thread calling AbstractRepositoryEventHandler.stopWriterSession() while another thread is attempting to lock a node using the same session in TimedJobHandler.runInBackground().
> There's already a writeLock object in TimedJobHandler that's apparently designed to protect against concurrent use of the writer session, but that protection doesn't seem to cover the stopWriterSession() method in the base class.

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