at-async interferes with cp #29944
Labels
bug
Indicates an unexpected problem or unintended behavior
filesystem
Underlying file system and functions that use it
It seems that Julia's
cp
function copies files in chunks of 64K. When callingcp
inside of@async
, as Pkg does, a task switch can leave the file in a partial state, i.e. the copy is not continued after the current chunk finishes. This results in files that are truncated to sizes that are multiples of 64K.This seems only to occur on slower filesystems, where task switches during a copy are more likely, as the copy operation is slower. Also note that
run
ning the systemcp
does not truncate files, since a task switch can't interrupt it.This issue is difficult to reproduce, as it requires a very specific set of circumstances to occur. It was originally observed and reported in JuliaLang/Pkg.jl#795. More background on the problem can be found in that issue. I'm moving the issue here as it's a problem with Julia (and/or libuv) rather than directly with Pkg.
The text was updated successfully, but these errors were encountered: