Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Hang in LockFile#waitForStatChange

See line 432 in


The thread waits for a lockfile to see the modification time of the packed-ref’s file advance

by one tick of the clock with the resolution of the filesystem’s timestamps. It’s saving the

locked file in a loop with a 25ms sleep until the modification timestamp increases by at least one tick.

This shouldn’t take 5 minutes.


This is done to prevent issues regarding “racy git” problem caused by granularity of timer resolution



From: <jgit-dev-bounces@xxxxxxxxxxx> on behalf of Duft Markus <Markus.Duft@xxxxxxxxxxxxxxxx>
Date: Thursday, 14. September 2017 at 08:11
To: "JGit Developers list (jgit-dev@xxxxxxxxxxx)" <jgit-dev@xxxxxxxxxxx>
Subject: [jgit-dev] Hang in LockFile#waitForStatChange




I observed this hang (over at least 5 minutes in the same frame – right now it looks like infinite) while testing the gerrit importer plugin:


"HTTP-91" #91 prio=5 os_prio=0 tid=0x00007f96ac020000 nid=0x575b waiting on condition [0x00007f97a87cf000]

   java.lang.Thread.State: TIMED_WAITING (sleeping)

        at java.lang.Thread.sleep(Native Method)



        at org.eclipse.jgit.lib.RefWriter.writePackedRefs(




        at org.eclipse.jgit.lib.RefUpdate$2.execute(

        at org.eclipse.jgit.lib.RefUpdate.updateImpl(

        at org.eclipse.jgit.lib.RefUpdate.delete(

        at org.eclipse.jgit.lib.RefUpdate.delete(

        at com.googlesource.gerrit.plugins.importer.CompleteProjectImport.deleteImportRefs(

        at com.googlesource.gerrit.plugins.importer.CompleteProjectImport.apply(

        at com.googlesource.gerrit.plugins.importer.CompleteProjectImport.apply(


It seems rather unrelated to the actual plugin, and more in the JGit area. Reading the code it does not really make much sense that it is hanging there – any idea what this could mean?






Mit freundlichen Grüßen / Best regards


Markus Duft | Software Architect

SSI SCHÄFER | SSI Schäfer IT Solutions GmbH | Friesachstraße 15 | 8114 Friesach bei Graz | Austria

Phone +43 3127 200-575 | Fax +43 3127 200-22


Website | Blog | YouTube | Facebook


SSI Schäfer IT Solutions GmbH | Friesachstrasse 15 | 8114 Friesach | Austria
Registered Office: Friesach | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Back to the top