Issue - two running process on the same user could copy their pex to the same place
Fix - put operation is slow, but remove and rename/mv are fast:
Since the expected behavior is to overwrite the destination with a newer pex, and move cannot overwrite:
only remove if we force upload (so that we can do the final move)
do a put to a temp destination
rename/mv from temp to final destination
Why we do not overwrite after the put at rename/mv time if the destination exists (race condition is met):
it would recreate a possibly inconsistent state
we fail only if the destination is different from the file being pushed to ensure a consistent state
Issue - two running process on the same user could copy their pex to the same place Fix - put operation is slow, but remove and rename/mv are fast: Since the expected behavior is to overwrite the destination with a newer pex, and move cannot overwrite:
only remove if we force upload (so that we can do the final move)
do a put to a temp destination
rename/mv from temp to final destination
Why we do not overwrite after the put at rename/mv time if the destination exists (race condition is met):
it would recreate a possibly inconsistent state
we fail only if the destination is different from the file being pushed to ensure a consistent state