Skip to content

Conversation

@TomSweeneyRedHat
Copy link
Member

The context must be valid for the entire lifetime of the request including reading the body, as such it is invalid to return the body after cancelling the context, depending of if all the response data arrived already or not this then might fail.

To fix this simply do not cancel the context here, we could move the cancel() up to the caller function that processes the body. However as that one already closes the body there should be no need to cancel the context to end the request.

Fixes: #2936

Fixes: https://issues.redhat.com/browse/RHEL-111077, https://issues.redhat.com/browse/RHEL-111076

The context must be valid for the entire lifetime of the request
including reading the body, as such it is invalid to return the body
after cancelling the context, depending of if all the response data
arrived already or not this then might fail.

To fix this simply do not cancel the context here, we could move the
cancel() up to the caller function that processes the body. However as
that one already closes the body there should be no need to cancel the
context to end the request.

Fixes: containers#2936

Fixes: https://issues.redhat.com/browse/RHEL-111077, https://issues.redhat.com/browse/RHEL-111076

Signed-off-by: Paul Holzinger <[email protected]>
Signed-off-by: tomsweeneyredhat <[email protected]>
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Luap99 Luap99 merged commit 50a6b67 into containers:release-5.36 Aug 26, 2025
9 checks passed
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for the record. Thank you!

@TomSweeneyRedHat TomSweeneyRedHat deleted the dev/tsweeney/backport_2938 branch August 26, 2025 13:36
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.

3 participants