-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add idle timeout support for Netty #5948
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
Conversation
| // Lightbend Config caches system properties. Ideally play.api.test.TestServer would be changed to allow passing | ||
| // config values when creating the server config | ||
| override def createServer(context: Context): NettyServer = { | ||
| val idleConfig = Configuration("play.server.idleTimeout" -> System.getProperty("play.server.idleTimeout")) ++ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it make more sense to have the http setting be play.server.http.idleTimeout?
Also these settings should be added and documented in the play-server reference.conf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea - under play.server.http makes more sense. I wasn't sure how to document these since they're added in a new point release but the docs are for 2.4.x. Just have a comment saying available in 2.4.7 on?
|
@bbarkley Seems reasonable. Were you planning on handling the forward port as well? I'm not worried much about the akka-http stuff, since the Akka server is still experimental. |
|
I can work on forward porting to 2.5.x and master |
|
Build is broken: https://travis-ci.org/playframework/playframework/jobs/119069584#L307 Is this really supposed to break binary compatibility? If so, you need to filter the method as suggested at the error message. |
|
Yea, I'm not familiar with the binary compatibility checker. It looks like it's complaining that I made a change to PlayPipelineFactory which is a private class, so I don't know why it would be checking it or complaining. Can someone verify it's safe to make this change and add that exclusion? |
|
@bbarkley It should be fine to add the exclusion. You should modify to the And you can run the check again with The binary compatibility checker will sometimes report "false positives" for scala package private classes since those aren't technically private from a bytecode perspective. |
|
Thanks for the help. I've added the necessary filter |
|
The failing WS test happened on my first and third diffs, but not the second and seems unrelated. Is there a way to kick off the tests again? |
|
I've kicked off the tests again. It's very odd that mima flagged the missing constructor as a binary compatibility issue, since Anyway, @bbarkley up to you if you want to do the forward port, as I said earlier, we'd be happy to handle it if you don't want to. |
|
@jroper - Thanks. I already took care of it for 2.5.x and I'm guessing master will not be much more effort if any. I'll open another PR after this goes through. |
|
Are the WS tests known to be flaky? I can't reproduce the failure locally. |
|
@bbarkley yes, unfortunately. This specific test was breaking for a lot of builds against 2.4.x branch. I was also unable to reproduce it locally. |
Purpose
This adds support for idle connection timeout to the Netty server. Separate timeouts can be defined for http and https connections.
Background Context
@jroper said that it would be alright to push this to the 2.4.x branch and it could be forward ported to 2.5.x and master
I was unable to get this working with the Akka server. While poking around the code it looks like there is an API for supporting idle timeout but it doesn't seem to be used currently (akka-http-core-experimental-1.0). I left TODOs where changes need to be made for Akka.