Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cancelling upload requests #259

Merged
merged 1 commit into from
Sep 9, 2024
Merged

Conversation

tanmaykm
Copy link
Member

@tanmaykm tanmaykm commented Sep 4, 2024

Cancelling an upload (PUT) request using the mechanism introduced in #256 was not effective. The upload task was not interrupted, which still blocked and the call to request did not return. With this change, cancelling also closes the input stream of the request to unblock the upload task.

Also changed the interrupted variable to be an Atomic{Bool}. Ref discussion here.

@tanmaykm tanmaykm marked this pull request as draft September 5, 2024 00:15
Cancelling an upload (PUT) request using the mechanism introduced in JuliaLang#256 was not effective. The upload task was not interrupted, which still blocked and the call to `request` did not return.
With this change, cancelling also closes the `input` stream of the request to unblock the upload task.

Also changed the `interrupted` variable to be an `Atomic{Bool}`. Ref discussion [here](JuliaLang#256 (comment)).
@tanmaykm tanmaykm marked this pull request as ready for review September 5, 2024 04:25
@tanmaykm
Copy link
Member Author

tanmaykm commented Sep 5, 2024

cc: @vtjnash @topolarity @KristofferC

@KristofferC KristofferC merged commit 89d3c7d into JuliaLang:master Sep 9, 2024
18 checks passed
tanmaykm added a commit to JuliaComputing/OpenAPI.jl that referenced this pull request Sep 24, 2024
Detect if we are using a newer version of Download.jl that supports interrupting of requests natively and use that instead of throwing `InterruptException`.

ref: JuliaLang/Downloads.jl#256 and JuliaLang/Downloads.jl#259

fixes: #81
tanmaykm added a commit to JuliaComputing/OpenAPI.jl that referenced this pull request Sep 24, 2024
Detect if we are using a newer version of Download.jl that supports interrupting of requests natively and use that instead of throwing `InterruptException`.

ref: JuliaLang/Downloads.jl#256 and JuliaLang/Downloads.jl#259

fixes: #81
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