)]}'
{
  "commit": "df323748d61b50311791dc3688471931040cc5fa",
  "tree": "eb58f43ae39fe9e551aa9d8ffd6c3c784852e2c4",
  "parents": [
    "642b4dc6aafda71f1f0c48f1c6e0b90420196469"
  ],
  "author": {
    "name": "tanzhengwei",
    "email": "tanzhengwei@google.com",
    "time": "Mon Aug 24 08:09:27 2026 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Mon Aug 24 08:11:59 2026 -0700"
  },
  "message": "Fix worker response reading when process has exited\n\nIn `SingleplexWorker.getResponse`, when `process.isAlive()` returned `false`, Bazel previously checked `recordingInputStream.available() \u003e 0` before breaking out of the loop. On macOS/BSD, `available()` on a pipe returns `0` after the writer process has exited, even if unread bytes (`WorkResponse`) remain in the OS pipe buffer.\n\nThis caused `SingleplexWorker` to throw a false-positive `IOException(\"Worker process ... died while waiting for response\")` on macOS when a worker voluntarily exited after completing a task (e.g., `--exit_after\u003d1`).\n\nBy breaking out of the loop when `!process.isAlive()`, Bazel attempts to read and parse the response via `workerProtocol.getResponse()`. If the worker produced a response, it is successfully parsed. If the worker crashed without returning a response, `getResponse()` returns `null` or throws an exception, resulting in proper error handling in `WorkerSpawnRunner`.\n\nPiperOrigin-RevId: 969859950\nChange-Id: I357b1e29ed107cd20896f00d123bdc42891f52db\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "aee201c66085a3ea5311272b5faa9bf03a15b03c",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/worker/SingleplexWorker.java",
      "new_id": "233a1d9441e399ca90ce31b0d820f3baf3028847",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/worker/SingleplexWorker.java"
    }
  ]
}
