)]}'
{
  "commit": "a483dcabceef5fbbf20b8c4d035592490b7c4f09",
  "tree": "6c2690f7d5219dcbfb40f333a2eb0461c2f94ccc",
  "parents": [
    "ef3ba89f468593c3b45ffb21d05e4b7dc071d7a3"
  ],
  "author": {
    "name": "Sasa Zivkov",
    "email": "sasa.zivkov@sap.com",
    "time": "Tue Aug 18 14:20:59 2026 +0200"
  },
  "committer": {
    "name": "Sasa Zivkov",
    "email": "sasa.zivkov@sap.com",
    "time": "Thu Oct 01 13:53:23 2026 +0200"
  },
  "message": "index: fix forwarded event flag and in-flight guard for async indexing\n\nContext.setForwardedEvent(true/false) was called in the base class\ntry/finally block on the calling thread. For the change handler, which\nsubmits work to an executor, this meant the flag was set on the wrong\nthread and cleared as soon as doIndex() returned the CompletableFuture,\nbefore the actual indexing work started on the executor thread. To\nworkaround that, the ForwardedIndexChangeHandler invoked\nContext.setForwardedEvent(true) again from the indexing task, which was\nan ugly workaround.\n\nSimilarly, inFlightIndexing.remove(id) was called in the finally block\non the calling thread, releasing the guard at future submission time\nrather than at future completion time.\n\nStop assuming that the indexing task is executed synchronously from the\ncalling thread.\n\nMove inFlightIndexing.remove(id) to a whenComplete() callback on the\nreturned future, so the guard is held for the full duration of the async\nwork.\n\nRemove setForwardedEvent/unsetForwardedEvent from the base class\nentirely and replace it with a withForwardedEventFlag() helper that\nconcrete handlers call when wrapping the actual indexing work,\nensuring the flag is set and cleared on the thread that does the work.\n\nChange-Id: I76ef61c760595d677db0ebf0f3ae1b057c51da9e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bee5f2e931d7fba97d0b47e8beec8f30bfd3fac7",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexAccountHandler.java",
      "new_id": "57d6a4ba4f3c34361babc86a8419bcb3ab7c7ba6",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexAccountHandler.java"
    },
    {
      "type": "modify",
      "old_id": "3bf5872a814ef6685194bf93e04abf98bb3fa3d1",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java",
      "new_id": "ca9e0f7c0ba5deb0cc37811c058984d9990b3333",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandler.java"
    },
    {
      "type": "modify",
      "old_id": "01f8680a69d9a04d52924eaefa177357fff3eda1",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexGroupHandler.java",
      "new_id": "8b3c451ee7be3fcd41e5eb8e14558099ad00284b",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexGroupHandler.java"
    },
    {
      "type": "modify",
      "old_id": "b16cb6e628ad0ec77f7bc4c22de3b2f4e1447f3d",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexProjectHandler.java",
      "new_id": "0607f818679403e64afdc1f3b40b7275f2f14221",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexProjectHandler.java"
    },
    {
      "type": "modify",
      "old_id": "6ce925aa9e2349c126cbb62ede198cca4e6e8097",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexingHandler.java",
      "new_id": "11d9eccc5bfa8ecf0c5003d895443b375f09e94c",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexingHandler.java"
    },
    {
      "type": "modify",
      "old_id": "851aa49b064ffe99711be3553c42709517508cc8",
      "old_mode": 33188,
      "old_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/AbstractIndexRestApiServlet.java",
      "new_id": "84ff1c5983e11a5887ad6ffe5eddbff308a11fbe",
      "new_mode": 33188,
      "new_path": "src/main/java/com/ericsson/gerrit/plugins/highavailability/forwarder/rest/AbstractIndexRestApiServlet.java"
    },
    {
      "type": "modify",
      "old_id": "e549e5019f4a0120b9638d2469d441ff78a32ecb",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexAccountHandlerTest.java",
      "new_id": "78e32fcbf0af7c1ff54bf794488e9231c345323e",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexAccountHandlerTest.java"
    },
    {
      "type": "modify",
      "old_id": "2ad8fedc4372febe65f1ab3af9ecd78cb225bc6f",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandlerTest.java",
      "new_id": "64464af9957b46753be785ccae7a2125d08de39e",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexChangeHandlerTest.java"
    },
    {
      "type": "modify",
      "old_id": "babe1d49d3926f4bb4d03c718425aa4c01cf09a2",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexGroupHandlerTest.java",
      "new_id": "8eedffdac67075f607937eecdeb34d4c9960a86c",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexGroupHandlerTest.java"
    },
    {
      "type": "modify",
      "old_id": "f91a83e463d09c8b3bbf349dbfc2633fd4da2c0a",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexProjectHandlerTest.java",
      "new_id": "d977acb7a388f9b0b7edf0a4830104f8c0a1e906",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/ForwardedIndexProjectHandlerTest.java"
    },
    {
      "type": "modify",
      "old_id": "39493a18b9a895ff708554cb6de67a8797bc5a82",
      "old_mode": 33188,
      "old_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/jgroups/MessageProcessorTest.java",
      "new_id": "58b06bc3a3625045685a2d026186e079c515ea05",
      "new_mode": 33188,
      "new_path": "src/test/java/com/ericsson/gerrit/plugins/highavailability/forwarder/jgroups/MessageProcessorTest.java"
    }
  ]
}
