v3.1.2
-----BEGIN PGP SIGNATURE-----

iQEzBAABCAAdFiEE8OJNpm/6pzcIHlp+H/+qXhhx93UFAl31Iy8ACgkQH/+qXhhx
93WmLgf/YZp8NUBxeDJE6q8G3DzhCUiVEqbTIClOKPd2knGSLm1irc4Apt5Vhqj0
1U+Rr0QqRKca57DJjQNnuzVk5OA2njyw8nsfrZiCbf7DHQYBlGDVAbyegB1BnKUW
OlbKK58DcaTdVTQss3PXveYty8v3bSUzWGAoZenQGzGTBtqU1aZVxegftmKSPmnG
fb32QDcFYFpBlB1bzAY0kkouxqdqAvf3gBfzU62UPPNlJgTIDu9qw57SFU+WiwYP
tmXLux6M2AHzw4zlAubFj6CH1srbaYo+jtgHB4h2QxLKfqA5Sb6nNvfIGutvr+BW
Az2liW7t50uZRUcJGRzGp30yCKKaOg==
=YGw9
-----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/