)]}'
{
  "commit": "73f1a0a58d801026da23cffc4c844e0065323dc3",
  "tree": "046ebf20c29baf6b7ecc9783e5971602d22d4946",
  "parents": [
    "e3cc481d5a0c53ad3574507ce43fdb6c9e71b30d"
  ],
  "author": {
    "name": "brandjon",
    "email": "brandjon@google.com",
    "time": "Tue Mar 06 14:19:47 2018 -0800"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-piper@google.com",
    "time": "Tue Mar 06 14:21:32 2018 -0800"
  },
  "message": "Make the builtins registry thread-safe\n\nIt was previously assumed that safety wasn\u0027t needed because\n\n  1) all builtins should be registered in static initializer blocks, and\n  2) all retrievals should occur during Skylark evaluation, after static initialization completes.\n\nIt turns out these assumptions aren\u0027t actually true (Who would\u0027ve thunk it!). SkylarkActionFactory has been observed to be initialized as late as analysis time, and retrievals occur as early as constructing a PackageFactory (when scanning the native module). The failure mode is particularly ugly: Random Skylark method lookups will fail non-deterministically.\n\nThis change guards against this by making the builtins registry implement a form of freezing. Before freezing, reads and writes are allowed and are synchronized. After freezing, only reads are allowed and they are unsynchronized for performance. BlazeRuntime is responsible for flipping the bit, and for ensuring classes like SkylarkActionFactory run their initialization by that point. Unit tests don\u0027t need to worry, since they just stay unfrozen and synchronized throughout.\n\nRELNOTES: None\nPiperOrigin-RevId: 188080136\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "e14bfc0046c6ce9aaa0df292ea00a07c4fcb7e77",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java",
      "new_id": "914be9b43fe67d0efe494dece53f70a7f95dd6f0",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/analysis/skylark/SkylarkActionFactory.java"
    },
    {
      "type": "modify",
      "old_id": "6932d9ea1807847abd0b2a7c3f14bdaa2364f697",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java",
      "new_id": "dab37d82cb5846cd2888600359be8b4e7ca84bbb",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java"
    },
    {
      "type": "modify",
      "old_id": "3decbebff508470c5344f997a61716ff48f333f4",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/syntax/Runtime.java",
      "new_id": "2c7b0ee9780776549f584683e8a0099f6e3b6970",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/syntax/Runtime.java"
    },
    {
      "type": "modify",
      "old_id": "346a91382017009d2313866f79bc0b336e074de0",
      "old_mode": 33188,
      "old_path": "src/main/java/com/google/devtools/build/lib/syntax/SkylarkSignatureProcessor.java",
      "new_id": "6424a47e44da9f00d9695a605c18d163b7893fb0",
      "new_mode": 33188,
      "new_path": "src/main/java/com/google/devtools/build/lib/syntax/SkylarkSignatureProcessor.java"
    },
    {
      "type": "modify",
      "old_id": "60df36ba701aadb00668a7d180bfc67a875e9a15",
      "old_mode": 33188,
      "old_path": "src/test/java/com/google/devtools/build/lib/syntax/RuntimeTest.java",
      "new_id": "9da686707a497c52048d0f962718e4c789442e31",
      "new_mode": 33188,
      "new_path": "src/test/java/com/google/devtools/build/lib/syntax/RuntimeTest.java"
    }
  ]
}
