[cipd] Make FileSystem.Replace more concurrency friendly.

Document its behavior better, add a test for concurrency edge cases.

Also slightly improve performance of replacing an empty directory: some time ago
os.Rename(...) changed to error out when 'newpath' is an empty directory. This
triggered a slower code path (moving to trash, cleaning up thrash). Now we try
to simply os.Remove(...) the file before moving it to trash.

Finally, do minor nit cleanups in logging and tests.

R=tandrii@chromium.org
BUG=972203

Change-Id: I95f2c5e1201f0cc9c323bca5171afb1fd5f9cddb
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/1650497
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
3 files changed
tree: 0c8b05f825aae5ceff37f52da6a1d71945fae470
  1. appengine/
  2. auth/
  3. buildbucket/
  4. cipd/
  5. client/
  6. common/
  7. config/
  8. cq/
  9. dm/
  10. examples/
  11. gce/
  12. grpc/
  13. hardcoded/
  14. logdog/
  15. luci_notify/
  16. lucicfg/
  17. lucictx/
  18. machine-db/
  19. milo/
  20. mmutex/
  21. mp/
  22. scheduler/
  23. scripts/
  24. server/
  25. starlark/
  26. swarming/
  27. tokenserver/
  28. tools/
  29. tumble/
  30. vpython/
  31. web/
  32. .gitattributes
  33. .travis.yml
  34. AUTHORS
  35. codereview.settings
  36. CONTRIBUTING.md
  37. CONTRIBUTORS
  38. LICENSE
  39. OWNERS
  40. pre-commit-go.yml
  41. PRESUBMIT.py
  42. README.md
README.md

luci-go: LUCI services and tools in Go

GoDoc

Installing

LUCI Go code is meant to be worked on from an Chromium infra.git checkout, which enforces packages versions and Go toolchain version. First get fetch via depot_tools.git then run:

fetch infra
cd infra/go
eval `./env.py`
cd src/go.chromium.org/luci

Contributing

Contributing uses the same flow as Chromium contributions.