)]}'
{
  "commit": "c1cff57bc7a46abbc9dced59de4a5a74b6f84d6a",
  "tree": "3e3ec9ee44ef29cd4496ff93585a5d9849b43b09",
  "parents": [
    "94d1aac44948afee11a785c7dfb8b774543ceec3"
  ],
  "author": {
    "name": "Marcin Czech",
    "email": "maczech@gmail.com",
    "time": "Fri May 15 15:33:04 2020 +0200"
  },
  "committer": {
    "name": "Luca Milanesio",
    "email": "luca.milanesio@gmail.com",
    "time": "Fri May 15 21:11:41 2020 +0000"
  },
  "message": "Do not block ref-updates during the configuration reload\n\nFor setups with a large number of remote configurations, configuration\nreload can be a time consuming operation. During the reload, the list of\nall destinations is blocked by a synchronized and thus any ref-update\nin Gerrit is blocked and cause a general outage until the replication\nplugin configuration is reloaded.\n\nThis situation happens because of a ref-update post action\nGitReferenceUpdatedListener.onGitReferenceUpdated(Event). This is\na blocking operation and it is calling another blocking method\nReplicationQueue.fire(NameKey,String, String, ReplicationState, boolean)\nand finally synchronized method DestinationsCollection.getAll(FilterType)\nis called. If DestinationCollection is during the configuration reload\nref-update have to wait on DestinationsCollection.getAll, this is causing\ngeneral lock for all operations against Gerrit instance.\n\nWith NoteDb, almost every operation in Gerrit causes a ref-update and,\ntherefore, would be blocked in that chain, causing a unique single sync\nin the entire Gerrit JVM that can bring an entire server down.\n\nSolution to that issue is to remove synchronization on\nDestinationsCollection.getAll to stop blocking ref-updates. Removing\nsynchronize keyword is still thread safe because we store destinations\nas an immutable list the only way of updating it is to replace it with\na new list. Since it is volatile, the update of destinations is atomic\nand thread safe.\n\nBug: Issue 12592\nChange-Id: Idcba1ef20a0ecde31e6a7ef6d827bf08746e5cb2\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "71c38d08ab1e878ec2465036be0700284651cec2",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/replication/DestinationsCollection.java",
      "new_id": "27e375639961e4ac000dc56c73fc1b8b699d9ae7",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/replication/DestinationsCollection.java"
    }
  ]
}
