v3.1.1
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQJLBAABCgA1FiEECnaesFM5uTvdiZXtDDr2ZJ/8IQIFAl3wht8XHGRwdXJzZWhv
dXNlQGNvbGxhYi5uZXQACgkQDDr2ZJ/8IQLiYA//VBJCg5199gFuuZM+XJSV+k3M
3St8S4llrnn0leR/OouymFcnyFnm7icUfHOP76S4nEEaAjvRAHD/sLy1WSXDT/x0
+2jihcVCflqE66lZhkCokoWOLaI5vDAGRWf1b7yW3S+cIg++IC9pbCzxj9d8KiNs
JzXcmShbbWoG7Z7zjR0S0Hn2NpR9Rv//OXLsFckhkMkdWiKDu8nbOkLjzf/0Gxts
9RyTw3OeY3NUf569Jt4wWIqt0WV4jFqkVSQU8jklVBuRfKTKGzne26v02XeSQHgR
FY7IBfL/NYF8v3NSoirE9q2+IwrPUEVAyQR/v68kQhektpAES4uFxYE6xAieXTOa
B3mvlhoxQB7TEsqMv8CAEnk5XmakXlHCZOVecuzAZjRfR1mThK29Rm0qWcw9hSSF
TZLdku9gL2H0yHv3jEokReahHDwR4Z7kS8DMrYvplTassO8jxryQA9KFaM/tIHPZ
BCBxGx2iTyRLcRqModw3gJV1T4wF/HfUzR1WLpQ2K4WZHLlXZvltqbD4XwyNx6Bg
pIfpZku6273bEVBbS+F2scX5qFiM0BgHekHYw5g/JtQyAYdulL18E6CGo/CNDpUh
54S9l3St74CVMUN06DKRMA/K7ho2k1LXg90NyxomIfLcMo5H/ePbBYtOym7Cx1yp
RDwXP2oZr4IzsAs2fE0=
=GSOp
-----END PGP SIGNATURE-----
Synchronize access to ReplicationTasksStorage

The ReplicationTasksStorage can be subject to concurrency issues when a
replication task is moved across directories (waiting/running/building)
concurrently with the listing.

The result of the uncontrolled concurrency could be lead to:

1. Flaky tests because of the replication tasks found two or more times
   in different directories
2. Flaky tests because of the failure to list replication tasks
   that are escaping across directories because of the rename
3. File-based exceptions when replication tasks are moved concurrently
   by two threads to different directories.

The replication tasks storage is supposed to contain only small files and only
in-flight operations: the overhead of the additional synchronisation is thus
negligible compared to the overall latency of the replication itself.

To eliminate all residual latency, cleanup all the replication tasks
on all subdirectories at the start of the tests.

Bug: Issue 11843
Change-Id: I5f6293b3f22f0943df79f8ab2cb2c217210e5236
2 files changed
tree: 150d53254d13c382418ee96e7a849a3449847b03
  1. .gitignore
  2. .mailmap
  3. .settings/
  4. BUILD
  5. LICENSE
  6. src/