)]}'
{
  "commit": "309a4028e72b5f6050d5cf17b5056cc3ea14c16b",
  "tree": "2dffc05c7a786a49558a67214a7d14afc439ab8f",
  "parents": [
    "898f80736c75878acc02dc55672317fcc0e0a5a6"
  ],
  "author": {
    "name": "Jeff King",
    "email": "peff@peff.net",
    "time": "Tue Dec 01 07:15:13 2020 -0500"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Tue Dec 01 12:05:58 2020 -0800"
  },
  "message": "upload-pack: kill pack-objects helper on signal or exit\n\nWe spawn an external pack-objects process to actually send objects to\nthe remote side. If we are killed by a signal during this process, then\npack-objects may continue to run. As soon as it starts producing output\nfor the pack, it will see a failure writing to upload-pack and exit\nitself. But before then, it may do significant work traversing the\nobject graph, compressing deltas, etc, which will all be pointless. So\nlet\u0027s make sure to kill as soon as we know that the caller will not read\nthe result.\n\nThere\u0027s no test here, since it\u0027s inherently racy, but here\u0027s an easy\nreproduction is on a large-ish repo like linux.git:\n\n  - make sure you don\u0027t have pack bitmaps (since they make the enumerating\n    phase go quickly). For linux.git it takes ~30s or so to walk the\n    whole graph on my machine.\n\n  - run \"git clone --no-local -q . dst\"; the \"-q\" is important because\n    if pack-objects is writing progress to upload-pack (to get\n    multiplexed over the sideband to the client), then it will notice\n    pretty quickly the failure to write to stderr\n\n  - kill the client-side clone process in another terminal (don\u0027t use\n    ^C, as that will send SIGINT to all of the processes)\n\n  - run \"ps au | grep git\" or similar to observe upload-pack dying\n    within 5 seconds (it will send a keepalive that will notice the\n    client has gone away)\n\n  - but you\u0027ll still see pack-objects consuming 100% CPU (and 1GB+ of\n    RAM) during the traversal and delta compression phases. It will exit\n    as soon as it starts to write the pack (when it will notice that\n    upload-pack went away).\n\nWith this patch, pack-objects exits as soon as upload-pack does.\n\nSigned-off-by: Jeff King \u003cpeff@peff.net\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3b858eb457e557592dada080f95f3fe7e218b24b",
      "old_mode": 33188,
      "old_path": "upload-pack.c",
      "new_id": "d4f7192d049b0853db3c64be02a6b914b39a289e",
      "new_mode": 33188,
      "new_path": "upload-pack.c"
    }
  ]
}
