diff options
author | Shawn Pearce <sop@google.com> | 2014-08-29 12:56:17 -0700 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2014-08-29 12:56:17 -0700 |
commit | 7b7d033ee1fdd8e81ae2ad7dc9e1ae12cbd9ddfa (patch) | |
tree | 8b48a2aa5fec8211288fa1e31682c4ea86fed390 | |
parent | 6be184e15ca1c3d1b50d269dd94973c24773f6ec (diff) | |
download | jgit-7b7d033ee1fdd8e81ae2ad7dc9e1ae12cbd9ddfa.tar.gz jgit-7b7d033ee1fdd8e81ae2ad7dc9e1ae12cbd9ddfa.zip |
UploadPack: Always make PackWriter.Statistics available
If the packer fails, still obtain the stats and make them available
to the logger and the caller. Failures can frequently happen when
a client disconnects in the middle of a pack stream. Server admins
may still want to examine the timing metrics from counting and
compressing phases.
Change-Id: Iceae4f68b5473f4223d85c9edfb57837fc818eed
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index b007f2b513..83806f129a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -1413,7 +1413,6 @@ public class UploadPack { } pw.writePack(pm, NullProgressMonitor.INSTANCE, packOut); - statistics = pw.getStatistics(); if (msgOut != NullOutputStream.INSTANCE) { String msg = pw.getStatistics().getMessage() + '\n'; @@ -1422,13 +1421,13 @@ public class UploadPack { } } finally { + statistics = pw.getStatistics(); + if (statistics != null) + logger.onPackStatistics(statistics); pw.release(); } if (sideband) pckOut.end(); - - if (statistics != null) - logger.onPackStatistics(statistics); } } |