Ember client doesn't shut down quickly when cancelled
See original GitHub issueTo replicate, set fork := true
, in your SBT config and compile the following:
import cats.data.Kleisli
import cats.effect.kernel.Resource
import cats.effect.{ExitCode, IO, IOApp}
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.ember.client.EmberClientBuilder
import org.http4s.implicits.http4sLiteralsSyntax
import com.comcast.ip4s._
object TestEmberClientHang extends IOApp.Simple {
def run: IO[Unit] = EmberClientBuilder.default[IO].build.use(_.statusFromUri(uri"http://localhost:8765")).void
}
object RunServer extends IOApp.Simple {
def run: IO[Unit] =
EmberServerBuilder.default[IO].withPort(port"8765").withHttpApp(Kleisli(_ => IO.never)).build.useForever
}
- Run
runMain RunServer
- In a different SBT session, run
runMain TestEmberClientHang
- Hit ctrl+c in the second SBT session (with
TestEmberClientHang
)
Expected: the TestEmberClientHang
process terminates immediately, like the version using the blaze client does.
Actual: the TestEmberClientHang
process continues to run for > 30 seconds
Tested on macOS 12.0.1 (21A559)
Issue Analytics
- State:
- Created 2 years ago
- Comments:32 (20 by maintainers)
Top Results From Across the Web
ember-server hanging on cancellation · Issue #6420 - GitHub
I extracted the test into a scala-cli runnable IOApp and did a ... Ember client doesn't shut down quickly when cancelled #6058 (comment)....
Read more >HTTP Client - http4s
Unlike the ember client, it does not need to be shut down. Like the ember-client, and any other http4s backend, it presents the...
Read more >Adopting ember-concurrency - LinkedIn Engineering
Automatically cancel tasks that are bound to a component: no need for the willDestroyElement hook—it is safe to assume that the UI code...
Read more >Ember FAQs - Comparably
If your Ember continues to disconnect or is unable to reconnect with your mobile device, there are a few quick steps that can...
Read more >Google's constant product shutdowns are damaging its brand
If we just take the official shutdown dates that have already occurred in 2019, a Google-branded product, feature, or service has died, on ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can confirm that this fixes it for me!
FWIW, the
nc
version of the test doesn’t work and I had to dobrew install netcat
on macOS to get both the fixed and unfixed versions working as expected without throwing exceptions.I’d like to express my gratitude for everyone who worked hard to reproduce/investigate/fix this issue
I think this might be possible to reproduce in a pure-scala context without any processes or signals, I might take a crack of that if I get a minute