Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bbarkley
Copy link
Contributor

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.

// 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")) ++
Copy link
Member

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.

Copy link
Contributor Author

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?

@gmethvin
Copy link
Member

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

@bbarkley
Copy link
Contributor Author

I can work on forward porting to 2.5.x and master

@marcospereira
Copy link
Member

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.

@bbarkley
Copy link
Contributor Author

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?

@gmethvin
Copy link
Member

@bbarkley It should be fine to add the exclusion. You should modify project/Build.scala to add:

ProblemFilters.exclude[MissingMethodProblem]("play.core.server.NettyServer#PlayPipelineFactory.this")

to the binaryIssueFilters in the PlayNettyServerProject.

And you can run the check again with sbt mimaReportBinaryIssues.

The binary compatibility checker will sometimes report "false positives" for scala package private classes since those aren't technically private from a bytecode perspective.

@bbarkley
Copy link
Contributor Author

Thanks for the help. I've added the necessary filter

@bbarkley
Copy link
Contributor Author

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?

@jroper
Copy link
Member

jroper commented Mar 30, 2016

I've kicked off the tests again.

It's very odd that mima flagged the missing constructor as a binary compatibility issue, since PlayPipelineFactory is a private class - I guess that's probably a bug in mima. @dotta should mima be flagging missing constructors on private classes?

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.

@bbarkley
Copy link
Contributor Author

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

@bbarkley
Copy link
Contributor Author

Are the WS tests known to be flaky? I can't reproduce the failure locally.

@marcospereira
Copy link
Member

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

@jroper jroper merged commit 709dde6 into playframework:2.4.x Mar 31, 2016
@bbarkley bbarkley deleted the idle-timeout branch March 31, 2016 00:15
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.

4 participants