[Bug]: snapshot download mishandles reader close errors
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
The bug is in the deferred reader close inside fetchFromGCSWithZstd in pkg/objectstorage/objects.go, around lines 369-377. Read how the function's error return is set, then change the deferred close so it only assigns the close error when no earlier error exists. Done means a successful download returns the close error, and a failed download keeps its original error. Check the package's existing tests, or add one that forces Close() to fail.
Written by the indexing model from the issue text.
Description
The deferred reader close in fetchFromGCSWithZstd checks err != nil before assigning the close error.
When the reader's Close() returns an error:
- If decompression succeeds, the function returns
nil, discarding the close error. - If decompression also fails, the close error overwrites the original decompression error.
The close error should be returned only when the download otherwise succeeds. If the download already failed, its original error should be preserved.
- Dominant language
- Go
- Stars
- 4.4k
- Forks
- 515
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 317
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from agent-substrate/substrate
-
[Bug]: e2e script flag parsing is brokenPossibly taken @ericcurtin claimed this 5 days ago. Openarea/dev-infra area/tests kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
agent-substrate/substrate#2217 · 1 comment ·
Maintainers usually reply within 1 day
-
Reject trailing YAML documents in actor-template create manifestsPossibly taken @ericcurtin claimed this 8 days ago. Openarea/cli kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
agent-substrate/substrate#2156 · 1 comment ·
Maintainers usually reply within 1 day
-
area/storage kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
agent-substrate/substrate#2155 · 1 comment ·
Maintainers usually reply within 1 day
-
Delete final-round GCS compose inputs after successful uploadsPossibly taken @ericcurtin claimed this 7 days ago. Openarea/storage kind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
agent-substrate/substrate#2154 ·
Maintainers usually reply within 1 day
-
docs/api-guide.md: "an actor occupies its whole worker" contradicts multi-actor workersPossibly taken @ericcurtin claimed this 6 days ago. Openarea/api kind/docs
Difficulty 1/5 Under an hour Newbie friendliness 88/100
agent-substrate/substrate#2152 ·
Maintainers usually reply within 1 day
All issues in agent-substrate/substrate
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
prime-radiant-inc/evener#4329 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
openwatersio/aiscast#277 ·
Maintainers usually reply within 1 day