Browse Source

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
tags/v3.5.0.201409071800-rc1
Shawn Pearce 9 years ago
parent
commit
7b7d033ee1
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java

+ 3
- 4
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java View File

} }


pw.writePack(pm, NullProgressMonitor.INSTANCE, packOut); pw.writePack(pm, NullProgressMonitor.INSTANCE, packOut);
statistics = pw.getStatistics();


if (msgOut != NullOutputStream.INSTANCE) { if (msgOut != NullOutputStream.INSTANCE) {
String msg = pw.getStatistics().getMessage() + '\n'; String msg = pw.getStatistics().getMessage() + '\n';
} }


} finally { } finally {
statistics = pw.getStatistics();
if (statistics != null)
logger.onPackStatistics(statistics);
pw.release(); pw.release();
} }


if (sideband) if (sideband)
pckOut.end(); pckOut.end();

if (statistics != null)
logger.onPackStatistics(statistics);
} }
} }

Loading…
Cancel
Save