)]}'
{
  "commit": "0ad368675bae1e3228c9146e092cd00cfb29ac27",
  "tree": "01e602b04dfba375108841feed248a3c25456bda",
  "parents": [
    "ae024d9daf9b98dfdc5d4449964645cd3d303ac1"
  ],
  "author": {
    "name": "Russ Cox",
    "email": "rsc@golang.org",
    "time": "Thu Sep 19 15:33:02 2019 -0400"
  },
  "committer": {
    "name": "Russ Cox",
    "email": "rsc@golang.org",
    "time": "Thu Sep 26 16:25:30 2019 +0000"
  },
  "message": "context: use fewer goroutines in WithCancel/WithTimeout\n\nIf the parent context passed to WithCancel or WithTimeout\nis a known context implementation (one created by this package),\nwe attach the child to the parent by editing data structures directly;\notherwise, for unknown parent implementations, we make a\ngoroutine that watches for the parent to finish and propagates\nthe cancellation.\n\nA common problem with this scheme, before this CL, is that\nusers who write custom context implementations to manage\ntheir value sets cause WithCancel/WithTimeout to start\ngoroutines that would have not been started before.\n\nThis CL changes the way we map a parent context back to the\nunderlying data structure. Instead of walking up through\nknown context implementations to reach the *cancelCtx,\nwe look up parent.Value(\u0026cancelCtxKey) to return the\ninnermost *cancelCtx, which we use if it matches parent.Done().\n\nThis way, a custom context implementation wrapping a\n*cancelCtx but not changing Done-ness (and not refusing\nto return wrapped keys) will not require a goroutine anymore\nin WithCancel/WithTimeout.\n\nFor #28728.\n\nChange-Id: Idba2f435c81b19fe38d0dbf308458ca87c7381e9\nReviewed-on: https://go-review.googlesource.com/c/go/+/196521\nReviewed-by: Brad Fitzpatrick \u003cbradfitz@golang.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "390f93c078f2dae96008f2745fb39153be7c50a8",
      "old_mode": 33188,
      "old_path": "src/context/context.go",
      "new_id": "b561968f31c7648fc465f694c745271bc8ae7569",
      "new_mode": 33188,
      "new_path": "src/context/context.go"
    },
    {
      "type": "modify",
      "old_id": "0e69e2f6fdefa85a0ea8bc24b78daf0845bb4b1b",
      "old_mode": 33188,
      "old_path": "src/context/context_test.go",
      "new_id": "869b02c92ee99741d2bc780a3e967993bab8eb07",
      "new_mode": 33188,
      "new_path": "src/context/context_test.go"
    },
    {
      "type": "modify",
      "old_id": "d14b6f1a32b8d52a62adc9a8b3b99720ac8830a1",
      "old_mode": 33188,
      "old_path": "src/context/x_test.go",
      "new_id": "e85ef2d50e5fd8cffad74f6c17f06669f3eb3935",
      "new_mode": 33188,
      "new_path": "src/context/x_test.go"
    },
    {
      "type": "modify",
      "old_id": "c914d66b4dd232ce6b4fa9c29431e82e1849ae89",
      "old_mode": 33188,
      "old_path": "src/go/build/deps_test.go",
      "new_id": "cbb0c59127d06470b640c8b014d47b4e53f91f33",
      "new_mode": 33188,
      "new_path": "src/go/build/deps_test.go"
    }
  ]
}
