Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:55 Go to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 21
Registered: December 2010
Junior Member
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,

Re: Cleaning up locks on application startup [message #1236605 is a reply to message #1235512] Mon, 27 January 2014 16:50 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1106
Registered: July 2009
Senior Member
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

Previous Topic:repository stuck in Rebase w/merge
Next Topic:GitHub
Goto Forum:

Current Time: Sat Dec 14 21:40:18 GMT 2019

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

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

Back to the top