|Re: [jgit-dev] Hang in LockFile#waitForStatChange|
Looks like the importer plugin should make use of the new BatchRefUpdate which was recently added to JGit
From looking at what the importer plugin is doing, I get the impression that the problem is not that this method hangs a long time on one call. It is just that the importer deletes (one by one) a few thousand refs, and calls this method for every single one. As there is a sleep in here, the chance to see this method in any stack dump is just very high J…
-rw-r--r-- 1 mduft salomon 125956 Sep 14 08:40 packed-refs
There are about 2000 refs in there (many refs/changes/xxx from gerrit of course), so it’s not exactly large – other repos here have 80000+ refs :D
So your filesystem has a timer resolution of 1 hour :-?
How large is that packed-refs file ?
Thanks. It turns out that it did finish. After like one hour or more… J
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
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)
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
Back to the top