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
CancellationException on cancelling PartUploadRequest #733
Comments
I haven't been able to reproduce this but I can trace it through the OkHTTP source to get a picture of what is happening: The OkHttp based engine adapts OkHttp invokes the
There are no documentation or issues related to this to confirm but the underlying assumption seems to be that I can see that the
I did find this comment interesting which wraps Cancellation is already wired up in executeAsync() which will cancel the underlying The internals of enqueue leads us to AsyncCall which is the outermost call site that wraps the entire call chain and deals with notifying via callback of any failures. On cancellation this should result in the continuation being resumed with an exception. When the underlying coroutine is already cancelled though this would just be ignored. TL;DR I think what we want todo is either (1) ignore any (1) would result in reaching this codepath first and then ultimately reaching the failure callback which would be ignored when the coroutine is already cancelling. (2) would result in the failure callback being invoked first which would also be ignored when the coroutine is already being cancelled. I think the safest option would be (2) wrap all of our exceptions in |
@aajtodd Thanks for diving deep into this issue. I agree with the second suggestion to convert the CancellationException to IOException to prevent okhttp crash the application. |
|
We are still observing this crash after updating to latest build; I have attached the new logs.
|
Closing as fixed now. Open a new ticket as necessary |
|
Describe the bug
App occasionally crashes on cancelling the CouroutineScope used to upload a part for multi-part upload to S3.
Expected behavior
Cancelling the request should not result in CancellationException crash.
Current behavior
App occasionally crashes on cancelling the coroutine used to upload part for multi-part upload to S3. This issue is similar to #704
Steps to Reproduce
Possible Solution
Catch the Exception and not bubble it up to the caller.
Context
No response
AWS Kotlin SDK version used
0.17.7-beta
Platform (JVM/JS/Native)
Native
Operating System and version
Android 10.
The text was updated successfully, but these errors were encountered: