)]}'
{
  "commit": "3e168ff4f358ccf972af06137fc3c4b22bd36c57",
  "tree": "7cfbfb463ccb0c05e1d891e1b27939aa2fc004ab",
  "parents": [
    "877f52684857aa1e5cf6d7146d493cbe9702e314"
  ],
  "author": {
    "name": "Saša Živkov",
    "email": "sasa.zivkov@sap.com",
    "time": "Mon Mar 11 13:23:11 2024 +0100"
  },
  "committer": {
    "name": "Saša Živkov",
    "email": "sasa.zivkov@sap.com",
    "time": "Mon Mar 11 13:23:11 2024 +0100"
  },
  "message": "Prevent ConcurrentModificationException for PushOne.refBatchesToPush\n\nThe PushOne.refBatchesToPush was a plain HashSet but r/w access to it\nwasn\u0027t synchronized. Under some circumstances, traversing a stream\ncreated on refBatchesToPush threw ConcurrentModificationException [1]\nwhich caused the thread to die. As a side effect of the thread-death,\nthe replication task would never reschedule itself but would remain in\nthe pending tasks and all follow-up replications to the same URI would\nbe consolidated into that pending task which would never run. Only a\nrestart of the replication plugin would resolve the issue.\n\n[1]\nERROR com.google.gerrit.server.git.WorkQueue : WorkQueue thread ReplicateTo-some-uri-2 threw exception\njava.util.ConcurrentModificationException\n        at java.base/java.util.HashMap$KeySpliterator.tryAdvance(HashMap.java:1730)\n        at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)\n        at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)\n        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)\n        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)\n        at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)\n        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)\n        at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)\n        at com.googlesource.gerrit.plugins.replication.PushOne.getLimitedRefs(PushOne.java:255)\n        at com.googlesource.gerrit.plugins.replication.PushOne.toString(PushOne.java:221)\n        at com.google.gerrit.server.git.WorkQueue$ProjectTask.toString(WorkQueue.java:760)\n        at java.base/java.lang.StringConcatHelper.stringOf(StringConcatHelper.java:453)\n        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:678)\n        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)\n        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)\n        at java.base/java.lang.Thread.run(Thread.java:840)\n\nChange-Id: I3f29779fd150868412e4994d307303d1dd8bde7b\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ed84087ff05f5c6c8cd83626d2e2077dcbf6f443",
      "old_mode": 33188,
      "old_path": "src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java",
      "new_id": "c25f3756c0d57871c005bc86fd6f08fa32666700",
      "new_mode": 33188,
      "new_path": "src/main/java/com/googlesource/gerrit/plugins/replication/PushOne.java"
    }
  ]
}
