Skip to content

fix(datasets): throw when finalizing a dataset upload fails - #187

Merged
tanmaykm merged 4 commits into
mainfrom
tan/close-dataset-version-status
Oct 19, 2026
Merged

tanmaykm merged 4 commits into
mainfrom
tan/close-dataset-version-status

Conversation

@tanmaykm

@tanmaykm tanmaykm commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Problem

upload_dataset and upload_project_dataset ignored the status of the request that finalizes (closes) the new dataset version. The code comment said _close_dataset_version throws on non-200, but _restcall uses status_exception=false, so it never did. A failed finalize went unnoticed: the upload appeared to succeed, but the new version was never committed and the dataset reported size 0.

Seen on the 2026-10-19 JuliaHub nightly against nightly-juliahub (run 39187276590). The close request reached websrvr, but RestAPIService didn't answer within 60s (499 0 60.001; an earlier version of this description wrongly said it never reached the server), and test/datasets-large-live.jl:24 failed with 0 == 220200960 instead of a clear error.

Separately, the project-dataset _close_dataset_version(::UUID, ...) had an inverted condition: it added filename to the close request only when local_path was nothing, so real uploads never sent it.

Change

  • upload_dataset and upload_project_dataset check the close response and throw via _throw_invalidresponse, which surfaces as JuliaHubError("Finalizing upload failed", ...).
  • src/projects.jl: send filename when local_path is set, matching src/datasets.jl.
  • Mocked tests: a 504 on close makes both functions throw, and the project close payload carries the file name.
  • CHANGELOG entries under Unreleased → Fixed.

Not changed

The close call still doesn't run _check_internal_error, unlike the open call, so a finalize failure reported inside a 200 response would still be missed.

Testing

Pkg.test() on Julia 1.12: 2313/2313 pass. With the src/ changes reverted, the new close-status tests fail.


Devin Review

upload_dataset and upload_project_dataset ignored the status of the
close-version request (_restcall does not throw on non-2xx), so a failed
finalize (e.g. a 504 from the edge proxy) went unnoticed and the upload
returned a dataset whose new version was never committed. Check the
status and throw via _throw_invalidresponse, which surfaces as
"Finalizing upload failed".
…pload

_close_dataset_version(::UUID, ...) had its condition inverted: it added
"filename" to the close request only when local_path was nothing, so real
uploads never sent it. Match the src/datasets.jl version.
devin-ai-integration[bot]

This comment was marked as resolved.

…a dataset version

_open_dataset_version already runs _check_internal_error on its response;
do the same in both _close_dataset_version methods so a legacy
{"success": false, "internal_error": true} close response fails the
upload instead of being accepted.
…close

Check the close response status outside of the try block that wraps
transport errors, so that 401/403 surface as InvalidAuthentication and
PermissionError (as they do for the open request) instead of being
wrapped in a generic JuliaHubError.
@tanmaykm
tanmaykm merged commit 3dfa350 into main Oct 19, 2026
20 checks passed
@tanmaykm
tanmaykm deleted the tan/close-dataset-version-status branch October 19, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants