Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new shutdown hooks in Akka 2.5 to prevent AbruptTerminationException in Http infrastructure #907

Open
jrudolph opened this issue Feb 27, 2017 · 5 comments
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:core Issues related to the akka-http-core module

Comments

@jrudolph
Copy link
Member

There are already some hook phases pre-allocated for exactly this purpose.

All active components should be shutdown in the hook:

  • Http().shutdownAllConnectionPools
  • Also introduce some infrastructure to track open server bindings and shut them down.
@jrudolph jrudolph added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:core Issues related to the akka-http-core module labels Feb 27, 2017
@jrudolph
Copy link
Member Author

Also, see akka/akka#18747 tracking to fix the problem in the streaming infrastructure directly.

@jonas
Copy link
Member

jonas commented Feb 28, 2017

I think this is highly related with the shutdown improvements proposed in #54 and #188

@jrudolph
Copy link
Member Author

Great, thanks for looking them up, @jonas.

@l15k4
Copy link

l15k4 commented Nov 8, 2017

So the idea is that http.shutdownAllConnectionPools should be called internally when actor system is terminating but currently one has to do it explicitly ?

@mr-git
Copy link

mr-git commented Nov 17, 2017

We do not like this "harmless" error message either.
We are using Akka 2.5.6 and Akka-http 10.0.10
Currently for integration tests we have code like:

  override protected def afterAll(): Unit = {
    Http().shutdownAllConnectionPools().andThen { case _ =>
      materializer.shutdown()
      system.terminate()
    }.futureValue
  }

And still in some cases we manage to get that exception, sometimes several of them.
I added extra useless code to materialiaze responses, like response.entity.toStrict(3.seconds).futureValue.data.decodeString("UTF-8"), this allowed to remove few such errors, but still one is left for each test suite.

Are we doing something wrong? Is it possible, that we are leaving something streaming behind?
In https://doc.akka.io/docs/akka-http/current/scala/http/client-side/host-level.html I didn't find any other pointers.

According to #497 it seems that flow...via...map is preferred over Http().singleRequest(...) calls. Is that expected approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Identifies issues that the core team will likely not have time to work on t:core Issues related to the akka-http-core module
Projects
None yet
Development

No branches or pull requests

4 participants