Skip to content

Conversation

@IanButterworth
Copy link
Member

@IanButterworth IanButterworth commented Jun 21, 2024

Fixes #2928

The error that Downloads.download throws when out of space (on a Mac) is


julia> Downloads.download("https://julialang-s3.julialang.org/bin/mac/aarch64/1.10/julia-1.10.4-macaarch64.dmg", "/Volumes/RAMDisk/file")
ERROR: SystemError: flush: No space left on device
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] systemerror
    @ ./error.jl:175 [inlined]
  [3] flush(s::IOStream)
    @ Base ./iostream.jl:70
  [4] arg_write(f::Downloads.var"#8#17"{Base.DevNull, Nothing, Vector{…}, Float64, Nothing, Bool, Nothing, Bool, String, Bool, Bool}, arg::IOStream)
    @ ArgTools ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/ArgTools/src/ArgTools.jl:136
  [5] #7
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:353 [inlined]
  [6] arg_read
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/ArgTools/src/ArgTools.jl:76 [inlined]
  [7] request(url::String; input::Nothing, output::IOStream, method::Nothing, headers::Vector{…}, timeout::Float64, progress::Nothing, verbose::Bool, debug::Nothing, throw::Bool, downloader::Nothing)
    @ Downloads ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:352
  [8] request
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:320 [inlined]
  [9] #3
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:258 [inlined]
 [10] open(f::Downloads.var"#3#4"{…}, args::String; kwargs::@Kwargs{…})
    @ Base ./io.jl:396
 [11] open_nolock
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/ArgTools/src/ArgTools.jl:35 [inlined]
 [12] arg_write(f::Function, arg::String)
    @ ArgTools ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/ArgTools/src/ArgTools.jl:103
 [13] #download#2
    @ ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:257 [inlined]
 [14] download(url::String, output::String)
    @ Downloads ~/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/share/julia/stdlib/v1.10/Downloads/src/Downloads.jl:246
 [15] top-level scope
    @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

@IanButterworth
Copy link
Member Author

@StefanKarpinski two thoughts:

  1. Should Downloads.download throw a specific error for lack of disk space that we catch here?
  2. Could we check for disk space before starting the download? Would that be possible/valid?

@DilumAluthge
Copy link
Member

Out of curiosity, when do we think the "out of disk space" error is occurring?

  1. When downloading the tar.gz file?
  2. When extracting the tar.gz file?

@IanButterworth
Copy link
Member Author

Logically it could be either

@IanButterworth IanButterworth merged commit 1e4497e into JuliaLang:master Jul 8, 2024
@IanButterworth IanButterworth deleted the ib/artifact_download_retry branch July 8, 2024 19:10
@StefanKarpinski
Copy link
Member

I'd be fine with a specific error for out of disk space but maybe we should introduce it in Base and use it for all operations that can run out of disk space.

IanButterworth added a commit that referenced this pull request Jul 13, 2024
KristofferC pushed a commit that referenced this pull request Jul 23, 2024
@KristofferC KristofferC mentioned this pull request Jul 23, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuda artifacts are downloaded repeatedly per Julia session

4 participants