question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

blaze-server error logs on shutdown

See original GitHub issue

Using 0.20.0-M5 blaze-server via the BlazeServerBuilder.

On shutdown I can find the following entries in my logs.

ERROR org.http4s.blaze.channel.nio1.NIO1HeadStage - Abnormal NIO1HeadStage termination
java.nio.channels.ShutdownChannelGroupException
at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:224)
at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:184)
at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run(SelectorLoop.scala:67)
 at java.base/java.lang.Thread.run(Thread.java:844)

ERROR org.http4s.server.blaze.Http1ServerStage$$anon$1 - Fatal Error: Error in requestLoop()
 java.nio.channels.ShutdownChannelGroupException
at org.http4s.blaze.channel.nio1.SelectorLoop.killSelector(SelectorLoop.scala:224)
at org.http4s.blaze.channel.nio1.SelectorLoop.org$http4s$blaze$channel$nio1$SelectorLoop$$runLoop(SelectorLoop.scala:184)
at org.http4s.blaze.channel.nio1.SelectorLoop$$anon$1.run

This happens during an integration test for which the server is shutdown while the client side is still running (blaze-client).

The server is running with the default configuration.

BlazeServerBuilder[Task]
    .bindHttp(port, interface)
    .withoutBanner
    .withHttpApp(myRouter)
    .resource
    .use(...)

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
igor-ramazanovcommented, May 29, 2019

@agourlay Doesn’t BlazeServerBuilder[Task].withNio2(true) solves the problem?

We had the same issue in our tests with a WebSockets http4s server and it went away with the above option.

1reaction
danichegcommented, Apr 1, 2022

Recently was did http4s/http4s#6198. So we hope the next releases will reduce some error logs. Especially about AlreadyShutdownException.

Read more comments on GitHub >

github_iconTop Results From Across the Web

blaze-server error logs on shutdown · Issue #672
This happens during an integration test for which the server is shutdown while the client side is still running (blaze-client). The server is ......
Read more >
[GRIDCLIENT_21] The mapping failed because an operation ...
This issue happens intermittently. It is seen when mappings that are submitted in blaze mode after blaze grid manager has shut down on...
Read more >
http4s/http4s - Gitter
Hi, we are trying graceful shut downs with http4s 0.20.11. How is it supposed to work? We have a BlazeServer, which receives a...
Read more >
How to gracefully shutdown http4s - scala
And if you want to shutdown using an URL e.g. ... orNotFound server <- BlazeServerBuilder[F](serverEc) .bindHttp(8080, "0.0.0.0") .
Read more >
FAQs
How can I get free pizza? ... Download our app to view your Flame balance and available rewards. Always make sure you log...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found