Skip to content

KTOR-3891 Cancel the source channel when a decoder's output is cancelled - #5905

Open
Ruslan Ibrahimau (IRus) wants to merge 1 commit into
ktorio:mainfrom
IRus:fix/decoder-cancel-source
Open

Ruslan Ibrahimau (IRus) wants to merge 1 commit into
ktorio:mainfrom
IRus:fix/decoder-cancel-source

Conversation

@IRus

Copy link
Copy Markdown
Contributor

The gzip, deflate and zstd decoders and ByteReadChannel.deflated read the source in a writer coroutine, but cancelling the returned channel did not cancel the source. A streaming client response whose decoded body was not read then never completed, because the engine body channel stayed open.

Subsystem
Client/Server, related modules

Motivation
https://youtrack.jetbrains.com/issue/KTOR-3891

Solution
Cancel source channel when decode channel was canceled

The gzip, deflate and zstd decoders and ByteReadChannel.deflated read the
source in a writer coroutine, but cancelling the returned channel did not
cancel the source. A streaming client response whose decoded body was not
read then never completed, because the engine body channel stayed open.
@IRus Ruslan Ibrahimau (IRus) changed the title KTOR-3891: Cancel the source channel when a decoder's output is cancelled KTOR-3891 Cancel the source channel when a decoder's output is cancelled Sep 25, 2026
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.

1 participant