Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
GOARCH: amd64
CGO_ENABLED: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5
with:
go-version: '1.22.12'
- name: Build Macos executable
Expand Down Expand Up @@ -49,8 +49,8 @@ jobs:
GOARCH: amd64
CGO_ENABLED: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5
with:
go-version: '1.22.12'
- name: go dependencies
Expand All @@ -77,7 +77,7 @@ jobs:
name: Linux build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@v4.2.2
- name: Build builder Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
GOARCH: amd64
CGO_ENABLED: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5
with:
go-version: '1.22.12'
- name: Build Macos executable
Expand All @@ -32,8 +32,8 @@ jobs:
GOARCH: amd64
CGO_ENABLED: 1
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@424fc82d43fa5a37540bae62709ddcc23d9520d4 # v2.1.5
- uses: actions/checkout@v4.2.2
- uses: actions/setup-go@v5
with:
go-version: '1.22.12'
- name: Build Windows executable
Expand All @@ -44,7 +44,7 @@ jobs:
name: Linux build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/checkout@v4.2.2
- name: Build builder Docker image
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
Expand All @@ -67,3 +67,4 @@ jobs:
run: |
set -x
./dx-download-agent download -max_threads=`nproc` test_files/single_file.manifest.json.bz2
./dx-download-agent inspect test_files/single_file.manifest.json.bz2
6 changes: 3 additions & 3 deletions dx_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func DxHttpRequestData(
for ccCnt := 0; ccCnt < contextCanceledNumRetries; ccCnt++ {
// Safety procedure to force timeout to prevent hanging
ctx2, cancel := context.WithCancel(ctx)
timer := time.AfterFunc(requestOverallTimout, func() {
timer := time.AfterFunc(requestOverallTimeout, func() {
cancel()
})
defer timer.Stop()
Expand Down Expand Up @@ -373,7 +373,7 @@ func DxHttpRequestData(
}

log.Printf("Filepart was not successfully downloaded within %.f minutes (only %d of %d bytes fetched). Retrying (attempt %d of %d).",
requestOverallTimout.Minutes(), bytesFetched, dataLen, ccCnt+1, contextCanceledNumRetries)
requestOverallTimeout.Minutes(), bytesFetched, dataLen, ccCnt+1, contextCanceledNumRetries)
time.Sleep(time.Duration(contextCanceledTimeout) * time.Second)
}

Expand Down Expand Up @@ -406,7 +406,7 @@ func DxAPI(

// Safety procedure to force timeout to prevent hanging
ctx2, cancel := context.WithCancel(ctx)
timer := time.AfterFunc(dxApiOverallTimout, func() {
timer := time.AfterFunc(dxApiOverallTimeout, func() {
cancel()
})
defer timer.Stop()
Expand Down
12 changes: 5 additions & 7 deletions util.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ const (
GiB = 1024 * MiB
)
const (
// Limit on an http request to S3/Azure object storage
requestOverallTimout = 6 * time.Minute
// Limit on an http request to cloud object storage
requestOverallTimeout = 6 * time.Minute

// An API request to the dnanexus servers should never take more
// An API request to the DNAnexus API should not take more
// than this amount of time
dxApiOverallTimout = 10 * time.Minute

dxApiOverallTimeout = 10 * time.Minute
// Extracted automatically with a shell script, so keep the format:
// version = XXXX
Version = "v0.6.2"
Version = "v0.6.3"
)

// Configuration options for the download agent
Expand Down
Loading