)]}'
{
  "commit": "afae3f08fe44ab87c6f445b94c647845b22220d0",
  "tree": "903332f3334c089fbee25d70dbf6aa92a93484e6",
  "parents": [
    "4be00a69ae3a0c4e7ef3a5f952254bacd16d0a2a"
  ],
  "author": {
    "name": "Zhongpeng Lin",
    "email": "zplin@uber.com",
    "time": "Wed Apr 17 13:11:24 2024 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Apr 17 20:11:24 2024 +0000"
  },
  "message": "fix: using thread pool on macOS (#1861)\n\nThe python parser uses ProcessPoolExecutor, which is problematic on\nmacOS when it is distributed as a zip file, leading to errors like:\n\n```\nTraceback (most recent call last):\n  File \"\u003cstring\u003e\", line 1, in \u003cmodule\u003e\n  File \"/var/folders/fw/vythc6112ygfsvky8mdb5p580000gn/T/Bazel.runfiles_esxfeg_v/runfiles/python3_aarch64-apple-darwin/lib/python3.9/multiprocessing/resource_tracker.py\", line 24, in \u003cmodule\u003e\n    from . import spawn\n  File \"/var/folders/fw/vythc6112ygfsvky8mdb5p580000gn/T/Bazel.runfiles_esxfeg_v/runfiles/python3_aarch64-apple-darwin/lib/python3.9/multiprocessing/spawn.py\", line 13, in \u003cmodule\u003e\n    import runpy\n  File \"/var/folders/fw/vythc6112ygfsvky8mdb5p580000gn/T/Bazel.runfiles_esxfeg_v/runfiles/python3_aarch64-apple-darwin/lib/python3.9/runpy.py\", line 19, in \u003cmodule\u003e\n    from pkgutil import read_code, get_importer\nModuleNotFoundError: No module named \u0027pkgutil\u0027\n```\n\nAccording to [\"Contexts and start methods\"\nsection](https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods)\nof the documentation:\n\n\u003e On macOS, the spawn start method is now the default. The fork start\nmethod should be considered unsafe as it can lead to crashes of the\nsubprocess as macOS system libraries may start threads.\n\nmeanwhile:\n\n\u003e The \u0027spawn\u0027 and \u0027forkserver\u0027 start methods generally cannot be used\nwith “frozen” executables (i.e., binaries produced by packages like\nPyInstaller and cx_Freeze) on POSIX systems.\n\nThis means there is no way to start a ProcessPoolExecutor when the\nPython zip file is running on macOS. This PR switches it to\nThreadPoolExecutor instead.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "daa6d2b47ceca7e9ff88bddae9772f1e62f8392a",
      "old_mode": 33188,
      "old_path": "gazelle/python/parse.py",
      "new_id": "ae9ce876806e4e19eebeaa18100665c2110e2021",
      "new_mode": 33188,
      "new_path": "gazelle/python/parse.py"
    }
  ]
}
