You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "fabrizio giustina (JIRA)" <ji...@apache.org> on 2005/10/02 23:47:47 UTC

[jira] Created: (JCR-233) repository lock file not removed without a clean shutdown

repository lock file not removed without a clean shutdown
---------------------------------------------------------

         Key: JCR-233
         URL: http://issues.apache.org/jira/browse/JCR-233
     Project: Jackrabbit
        Type: Bug
  Components: core  
    Versions: 1.0    
    Reporter: fabrizio giustina


actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.

The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
- when an instance is loaded create a ".lock" file and open it with exclusive access
- when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.


-- 
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-233) repository lock file not removed without a clean shutdown

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-233?page=comments#action_12331139 ] 

Marcel Reutegger commented on JCR-233:
--------------------------------------

Edgar wrote:
> Clean shutdowns are very important, actually I turned my repository inconsistent a couple of times killing the jvm process.

IMO the repository should be able to handle such process kills, if it is not we should fix it. There are far too many components involved, which are not 100% reliable. JVMs will always crash, at least the ones that are available right now. So there is no way we can get around this.

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina

>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

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

Tobias Strasser commented on JCR-233:
-------------------------------------

i also opt for an exclusive file lock mechanism. i already have a patched version running...i will provide the patch shortly

btw: you can use process explorer (http://www.sysinternals.com/Utilities/ProcessExplorer.html) to search the process that has locked the file and terminate it (like fuser on unix). sometimes it was even explorer.exe that had the lock.



> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina

>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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] Closed: (JCR-233) repository lock file not removed without a clean shutdown

Posted by "Tobias Strasser (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-233?page=all ]
     
Tobias Strasser closed JCR-233:
-------------------------------

    Resolution: Fixed

fixed as proposed.

Author: tripod
Date: Tue Oct 11 05:37:32 2005
New Revision: 312865

URL: http://svn.apache.org/viewcvs?rev=312865&view=rev
Log:
JCR-233 repository lock file not removed without a clean shutdown

Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java



> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Reporter: fabrizio giustina
>     Assignee: Tobias Strasser
>      Fix For: 1.0
>  Attachments: replock.293087.diff
>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

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

Tobias Strasser commented on JCR-233:
-------------------------------------

i though of creating and deleting the .lock file as before, but using an exclusive filelock for the actual locking. so if a starting repository detetcs an existing .lock file, it can issue a warning, that the repository was not shutdown properly.

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina
>  Attachments: replock.293087.diff
>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

Posted by "Marcel Reutegger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-233?page=comments#action_12331137 ] 

Marcel Reutegger commented on JCR-233:
--------------------------------------

I also like the approach to use an exclusive file lock.

As a consequence it seems that creating and removing the .lock file is of no use anymore, because it does not actually indicate whether an instance is really using the lock file. The primary indicator is the presence on an exclusive lock on a well known file.

So, how about initially creating the lock file if it is not there and then use only file locking to prevent multiple instances running on the same repository data?

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina

>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

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

Tobias Strasser updated JCR-233:
--------------------------------

    Attachment: replock.293087.diff

patch for exclusive locking

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina
>  Attachments: replock.293087.diff
>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

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

Jukka Zitting updated JCR-233:
------------------------------

    Fix Version: 1.0
        Version:     (was: 1.0)

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Reporter: fabrizio giustina
>      Fix For: 1.0
>  Attachments: replock.293087.diff
>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

Posted by "Edgar Poce (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/JCR-233?page=comments#action_12331101 ] 

Edgar Poce commented on JCR-233:
--------------------------------

> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.

Not only a live instance ... The idea was no only to prevent 2 jackrabbit instances running but also to let the user know that the repository wasn't shutdown propertly. Clean shutdowns are very important, actually I turned my repository inconsistent a couple of times killing the jvm process.

> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access

I'm not sure but I think this was the policy for the index lock some months ago, and I'm happy it changed because a few times I had to reboot XP when I killed the jvm process. I couldn't remove the lock, not even from the explorer. So, I don't think it's a good idea to change the current behaviour.

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Versions: 1.0
>     Reporter: fabrizio giustina

>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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-233) repository lock file not removed without a clean shutdown

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

Tobias Strasser reassigned JCR-233:
-----------------------------------

    Assign To: Tobias Strasser

> repository lock file not removed without a clean shutdown
> ---------------------------------------------------------
>
>          Key: JCR-233
>          URL: http://issues.apache.org/jira/browse/JCR-233
>      Project: Jackrabbit
>         Type: Bug
>   Components: core
>     Reporter: fabrizio giustina
>     Assignee: Tobias Strasser
>      Fix For: 1.0
>  Attachments: replock.293087.diff
>
> actually when a repository is loaded a ".lock" file is created. This file is removed only after a clean shutdown but, if a jackrabbit instance has been killed, you have to manually delete the file in order to load the repository again, also if there was no live instance of jackrabbit that was using it.
> The problem comes from the fact that the simple presence of the .lock file is used to indicate a live instance.
> I suggest replacing this behavior using this method (used for example by eclipse when opening workspaces):
> - when an instance is loaded create a ".lock" file and open it with exclusive access
> - when a new instance is started try to delete an eventual .lock file. Only if the file can't be deleted because in use assume that another jackrabbit instance is running.

-- 
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