Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Cleaning up locks on application startup(Cleaning up locks on application startup)
Cleaning up locks on application startup [message #1235512] Fri, 24 January 2014 09:55 Go to next message
Eclipse UserFriend
I have a server side application whose storage is backed up by JGit.

If the application crashes, or is killed, it is possible (it already happened in practice) that some lock files remain on disk, e.g. .git/refs/heads/master.lock

My question is, are there administration methods / ways, via JGit API, to cleanup this kind of false positive when the application starts up ?

I can consider just walking the .git repository and remove all *.lock files found there, but maybe it's just one of many problems that could occur when the application is killed while it was busy with jgit, and this is already handled by some jgit code ?

Thanks in advance,

--
Laurent
Re: Cleaning up locks on application startup [message #1236605 is a reply to message #1235512] Mon, 27 January 2014 11:50 Go to previous message
Eclipse UserFriend
It looks like your application tried to update the master branch when it crashed. File locks are implemented by jgit's
LockFile class. You may try to get rid of stale locks caused by crashes using LockFile.unlock().

source code
https://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/LockFile.java

javadoc
http://download.eclipse.org/jgit/docs/jgit-3.2.0.201312181205-r/apidocs/org/eclipse/jgit/internal/storage/file/LockFile.html
Previous Topic:repository stuck in Rebase w/merge
Next Topic:GitHub
Goto Forum:
  


Current Time: Wed Jul 02 19:06:38 EDT 2025

Powered by FUDForum. Page generated in 0.28020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top