Skip to content

Propagate cancellation for http4s backend - #2984

Open
cwe-dixa wants to merge 1 commit into
softwaremill:masterfrom
cwe-dixa:feat/cancellation-for-http4s-backend
Open

Propagate cancellation for http4s backend#2984
cwe-dixa wants to merge 1 commit into
softwaremill:masterfrom
cwe-dixa:feat/cancellation-for-http4s-backend

Conversation

@cwe-dixa

@cwe-dixa cwe-dixa commented Sep 3, 2026

Copy link
Copy Markdown

Previously, cancelling a request using the http4s backend did not attempt to cancel the underlying request but instead returned instantly.

This PR changes the behavior to cancel the underlying request fiber if the "outer" request is cancelled.

Note that this means that where cancellation was essentially instant before, it now depends on however long it takes to cancel the request fiber. I would argue this fits better with cats-effect (cooperative cancellation and all), but it is a behavior change nonetheless.

Before submitting pull request:

  • Check if the project compiles by running sbt compile
  • Verify docs compilation by running sbt compileDocs
  • Check if tests pass by running sbt test
  • Format code by running sbt scalafmt

Previously, cancelling a request using the http4s backend did not
attempt to cancel the underlying request but instead returned instantly.

This PR changes the behavior to cancel the underlying request fiber if
the "outer" request is cancelled.

Note that this means that where cancellation was essentially instant
before, it now depends on however long it takes to cancel the request
fiber. I would argue this fits better with cats-effect (cooperative
cancellation and all), but it is a behavior change nonetheless.
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