You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened and how can we reproduce this issue?
In my application I need to get images, my codebase has a cache that I store the images in.
Get a large response, such as image, in my application I get a Flow
Use HttpResponse.bodyAsChannel(), in my application I pipe it all directly to a cache so there isn't a large amount of memory taken.
It eventually throws an exception, here is a small portion of the body
kotlinx.coroutines.JobCancellationException:Parent job isCompleted
at kotlinx.coroutines.JobSupport.getChildJobCancellationCause(JobSupport.kt:714) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.createCauseException(JobSupport.kt:720) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.makeCancelling(JobSupport.kt:752) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.cancelImpl$kotlinx_coroutines_core(JobSupport.kt:671) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.parentCancelled(JobSupport.kt:637) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.ChildHandleNode.invoke(JobSupport.kt:1466) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.ChildHandleNode.invoke(JobSupport.kt:1462) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.invokeOnCompletion(JobSupport.kt:1549) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.Job$DefaultImpls.invokeOnCompletion$default(Job.kt:341) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.attachChild(JobSupport.kt:970) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.JobSupport.initParentJob(JobSupport.kt:150) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.AbstractCoroutine.<init>(AbstractCoroutine.kt:51) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
at kotlinx.coroutines.StandaloneCoroutine.<init>(Builders.common.kt:194) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:?]
What did you expect to happen?
The image would be piped into the cache and it wouldnt error.
Is there anything else we need to know about?
Maybe use the current coroutine job instead of making a new one for each request? Not sure how it has its own though, couldnt find the code that causes it.
The text was updated successfully, but these errors were encountered:
Huh, and then I fix it 5 mins later. Basically the issue is that the FlowRequestConverter(and probably other converters) call response.body(info) when the return type is a HttpResponse, which makes another HttpResponse that for some reason errors when trying to get the real body. I fixed it by changing
Ktorfit version
1.0.0-beta14
What happened and how can we reproduce this issue?
In my application I need to get images, my codebase has a cache that I store the images in.
What did you expect to happen?
The image would be piped into the cache and it wouldnt error.
Is there anything else we need to know about?
Maybe use the current coroutine job instead of making a new one for each request? Not sure how it has its own though, couldnt find the code that causes it.
The text was updated successfully, but these errors were encountered: