Skip to content

Propagate cancellation for http4s backend - #2984

Merged
adamw merged 3 commits into
softwaremill:masterfrom
cwe-dixa:feat/cancellation-for-http4s-backend
Sep 25, 2026
Merged

adamw merged 3 commits 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
Contributor

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.
@adamw

adamw commented Sep 25, 2026

Copy link
Copy Markdown
Member

Yes, definitely that's the "cats-effect" way of doing things. Thanks!

@adamw
adamw merged commit ac6cb3c into softwaremill:master Sep 25, 2026
22 checks passed
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.

2 participants