You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2006/05/31 12:01:29 UTC

[jira] Created: (JCR-446) Prevent logins during repository shutdown

Prevent logins during repository shutdown
-----------------------------------------

         Key: JCR-446
         URL: http://issues.apache.org/jira/browse/JCR-446
     Project: Jackrabbit
        Type: Improvement

  Components: core  
    Versions: 1.0, 1.0.1, 0.9    
    Reporter: Jukka Zitting
    Priority: Minor


Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-446?page=comments#action_12414027 ] 

Jukka Zitting commented on JCR-446:
-----------------------------------

Sorry, I was looking at an older version of RepositoryImpl. The JCR-445 changes modified the synchronization in RepositoryImpl, so my point about wspInfos is already being taken care of. Thanks, Toby! :-)

The login/shutdown issue still exists, and it looks as if a 'shutdown' lock would be the best solution with the current approach to synchronization. The issue isn't too urgent though, so consider this low priority for now.

> Prevent logins during repository shutdown
> -----------------------------------------
>
>          Key: JCR-446
>          URL: http://issues.apache.org/jira/browse/JCR-446
>      Project: Jackrabbit
>         Type: Improvement

>   Components: core
>     Versions: 1.0, 1.0.1, 0.9
>     Reporter: Jukka Zitting
>     Priority: Minor

>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-446) Prevent logins during repository shutdown

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-446?page=comments#action_12414020 ] 

Tobias Bocanegra commented on JCR-446:
--------------------------------------

i'm a bit afraid on sychronizing the repository instance. i prefer a 'shutdown' lock around shutdown and login.

> Prevent logins during repository shutdown
> -----------------------------------------
>
>          Key: JCR-446
>          URL: http://issues.apache.org/jira/browse/JCR-446
>      Project: Jackrabbit
>         Type: Improvement

>   Components: core
>     Versions: 1.0, 1.0.1, 0.9
>     Reporter: Jukka Zitting
>     Priority: Minor

>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-446?page=all ]

Jukka Zitting resolved JCR-446.
-------------------------------

    Resolution: Fixed

Proposed patch applied in revision 447148.

> Prevent logins during repository shutdown
> -----------------------------------------
>
>                 Key: JCR-446
>                 URL: http://issues.apache.org/jira/browse/JCR-446
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.0, 1.0.1, 0.9
>            Reporter: Jukka Zitting
>         Assigned To: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: shutdown-lock.patch
>
>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-446?page=all ]

Jukka Zitting updated JCR-446:
------------------------------

    Fix Version: 1.1

> Prevent logins during repository shutdown
> -----------------------------------------
>
>          Key: JCR-446
>          URL: http://issues.apache.org/jira/browse/JCR-446
>      Project: Jackrabbit
>         Type: Improvement

>   Components: core
>     Versions: 0.9, 1.0, 1.0.1
>     Reporter: Jukka Zitting
>     Priority: Minor
>      Fix For: 1.1

>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-446?page=comments#action_12414024 ] 

Jukka Zitting commented on JCR-446:
-----------------------------------

Looking at the code I actually think that getWorkspaceInfo() *should* be synchronized regardless of what we do with login. The wspInfos map is not necessarily thread-safe, so invoking get() on it (or keySet() in getWorkspaceNames()) may cause a problem if a concurrent thread is invoking a synchronized createWorkspace() method. Thus I actually think that either the wspInfos map or the getWorkspaceInfo() and getWorkspaceNames() should be synchronized.

On the other hand login() should not be synchronized, as the JAAS authentication could easily block other threads while waiting for the user to enter a password or something similar.

In any case, the crucial part seems  to be the createSession() methods, that are currently synchronized, but do not invoke the sanityCheck() method. Thus it is possible for login() to start and invoke sanityCheck() before a shutdown is initiated, but stall waiting for user credentials during JAAS authentication. If during that time the repository is shutdown, login() will still continue to call createSession() without any more sanity checks. Adding sanityCheck() calls to the createSession() methods should solve this quite nicely.

> Prevent logins during repository shutdown
> -----------------------------------------
>
>          Key: JCR-446
>          URL: http://issues.apache.org/jira/browse/JCR-446
>      Project: Jackrabbit
>         Type: Improvement

>   Components: core
>     Versions: 1.0, 1.0.1, 0.9
>     Reporter: Jukka Zitting
>     Priority: Minor

>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-446?page=all ]

Jukka Zitting reassigned JCR-446:
---------------------------------

    Assignee: Jukka Zitting

> Prevent logins during repository shutdown
> -----------------------------------------
>
>                 Key: JCR-446
>                 URL: http://issues.apache.org/jira/browse/JCR-446
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.0, 1.0.1, 0.9
>            Reporter: Jukka Zitting
>         Assigned To: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: shutdown-lock.patch
>
>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JCR-446) Prevent logins during repository shutdown

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-446?page=all ]

Jukka Zitting updated JCR-446:
------------------------------

    Attachment: shutdown-lock.patch

Attached a proposed patch that implements the shutdown lock idea. The lock is a ReadWrite lock that allows any number of concurrent readers (logins) but only one concurrent writer (shutdown).

Passes all unit tests and seems to work fine under normal loads. I'll apply the patch unless anyone objects.

> Prevent logins during repository shutdown
> -----------------------------------------
>
>                 Key: JCR-446
>                 URL: http://issues.apache.org/jira/browse/JCR-446
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.0, 1.0.1, 0.9
>            Reporter: Jukka Zitting
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: shutdown-lock.patch
>
>
> Related to the last comment in JCR-445, should we prevent new sessions from being created during repository shutdown? It is an odd chance to run into a problem like that, but it seems like the issue could be easily solved by making getWorkspaceInfo() synchronized and adding sanityCheck() calls to the createSession() methods.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira