)]}'
{
  "commit": "019700f0951df0adfcb373ea584fdc91994608ea",
  "tree": "702b33dd2c5e49e73251d6ac55090d7dffbe3844",
  "parents": [
    "aa8125a4aa6375a57a7e5422df842eada784a9ae"
  ],
  "author": {
    "name": "Luca Milanesio",
    "email": "luca.milanesio@gmail.com",
    "time": "Mon Dec 14 16:10:17 2020 +0000"
  },
  "committer": {
    "name": "Luca Milanesio",
    "email": "luca.milanesio@gmail.com",
    "time": "Thu Dec 17 22:23:13 2020 +0000"
  },
  "message": "Fix indexing locks on the sender side\n\nReplace locks with semaphores when blocking multiple\noperations on the sender side for the same index name + id.\n\nUsing native locks would require to have exactly\nthe same thread holding the lock, which may or may not\nbe the case for forwarding a remote indexing operation.\n\nWhen running a remote indexing, the operation may be\nretried multiple times in different threads, hence the use\nof a Semaphore instead of a Lock is more appropriate.\nWhen remote indexing is not retried, the execution is\ndelegated to a REST forwarder executor that makes the remote\ninvocation and returns the result in a different thread,\nfailing to release the lock.\n\nThe failure to release the lock is not detected because\nthe execution is swallowed by the lambda: the situation isn\u0027t\nimmediately critical, because *IF* there is no huge load\nof changes coming through, the next invocation may land on the\nsame thread. However, if that doesn\u0027t happen because of\nparallel load using more threads, the JVM ends up in deadlock.\n\nSemaphores do not require to be acquired and released by\nthe same threads and would functionally perform the same\ntype of exclusive \"logical locking\" for preventing the\nconcurrent reindexing of the same entity.\n\nBug: Issue 13824\nChange-Id: I39484b0d0cdf21d60bf334d1d1fa90f07ea28bba\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "332a7d60a4a97eecfda0b7a9d7ac1f17d2c94a54",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/index/IndexEventLocks.java",
      "new_id": "7dad07d80c2d2af9b1c08b8fcd4256aadcfc4eeb",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/index/IndexEventLocks.java"
    },
    {
      "type": "modify",
      "old_id": "ffad41fab284bbf853bf1e1344b70675db7db8e5",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/index/IndexEventHandlerTest.java",
      "new_id": "17013ccf96df13c2a8d24ab4732aa564a476502f",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/index/IndexEventHandlerTest.java"
    }
  ]
}
