Skip to content

Commit 1f491aa

Browse files
jenkinsjenkins
authored andcommitted
Merge commit '97277d5888b7b80debdfd5bd626473d446a17715'
2 parents 3fcac0e + 97277d5 commit 1f491aa

74 files changed

Lines changed: 1169 additions & 444 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git:
88
quiet: true
99

1010
env:
11-
- JAVA_OPTS="-DSKIP_FLAKY=true -Dsbt.log.noformat=true"
11+
- JAVA_OPTS="-Dsbt.log.noformat=true"
1212

1313
# These directories are cached to S3 at the end of the build
1414
cache:
@@ -28,7 +28,7 @@ scala:
2828
- 2.12.8
2929

3030
jdk:
31-
- oraclejdk8
31+
- openjdk8
3232

3333
notifications:
3434
slack:

CHANGELOG.rst

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,45 @@ Note that ``RB_ID=#`` and ``PHAB_ID=#`` correspond to associated message in comm
77
Unreleased
88
----------
99

10+
19.9.0
11+
------
12+
13+
Added
14+
~~~~~
15+
16+
* finatra-kafka: Add `withConfig` method variant which takes a `Map[String, String]`
17+
to allow for more complex configurations ``PHAB_ID=D354389``
18+
19+
Changed
20+
~~~~~~~
21+
22+
* finatra: Remove commons-lang as a dependency and replace it with alternatives from stdlib
23+
when possible. ``PHAB_ID=D354013``
24+
25+
* inject-server: Changed `c.t.inject.server.InMemoryStatsReceiverUtility` to show the expected and
26+
actual values as part of the error message when metric values do not match. ``PHAB_ID=D360470``
27+
28+
* finatra-kafka-streams: Improve StaticPartitioning error message ``PHAB_ID=D351368``
29+
30+
Fixed
31+
~~~~~
32+
33+
* finatra-http: Support Http 405 response code, improve routing performance for non-constant route
34+
``PHAB_ID=D278146``
35+
36+
* inject-app: Update `c.t.inject.app.App` to only recurse through modules once. We currently
37+
call `TwitterModule#modules` more than once in reading flags and parsing the list of modules
38+
over which to create the injector. When `TwitterModule#modules` is a function that inlines the
39+
instantiation of new modules we can end up creating multiple instances causing issues with the
40+
list of flags defined in the application. This is especially true in instances of `TwitterModule`
41+
implemented in Java as there is no way to implement the trait `TwitterModule#modules` method as a
42+
eagerly evaluated value. We also don't provide an ergonomic method for Java users to define
43+
dependent modules like we do in apps and servers via `App#javaModules`. Thus we also add a
44+
`TwitterModule#javaModules` function which expresses a better API for Java users. ``PHAB_ID=D349587``
45+
46+
Closed
47+
~~~~~~
48+
1049
19.8.0
1150
------
1251

@@ -21,9 +60,9 @@ Added
2160
* finatra-jackson: Add the ability to specify `fields` in the `MethodValidation` annotation.
2261
``PHAB_ID=D338079``
2362

24-
2563
Changed
2664
~~~~~~~
65+
* finatra-kafka: Make KafkaConsumerConfig config public from FinagleKafkaConsumerBuilder. ``PHAB_ID=D362058``
2766

2867
* inject-thrift-client: make ThriftClientModuleTrait extend StackClientModuleTrait for symmetry
2968
with other protocol client modules. ``PHAB_ID=D342710``

benchmarks/src/test/scala/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ junit_tests(
99
"3rdparty/jvm/com/google/inject/extensions:guice-assistedinject",
1010
"3rdparty/jvm/com/google/inject/extensions:guice-multibindings",
1111
"3rdparty/jvm/com/google/inject/extensions:guice-testlib",
12-
"3rdparty/jvm/commons-lang",
1312
"3rdparty/jvm/joda-time",
1413
"3rdparty/jvm/net/codingwell:scala-guice",
1514
"3rdparty/jvm/org/openjdk/jmh:jmh-core",

benchmarks/src/test/scala/com/twitter/finatra/http/benchmarks/RouteBenchmark.scala

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ import scala.reflect.classTag
1212
* ./sbt 'project benchmarks' 'jmh:run RouteBenchmark'
1313
*/
1414
@State(Scope.Thread)
15-
class RouteBenchmark
16-
extends StdBenchAnnotations
17-
with HttpBenchmark {
15+
class RouteBenchmark extends StdBenchAnnotations with HttpBenchmark {
1816

1917
val route = Route(
2018
name = "groups",
@@ -57,17 +55,22 @@ class RouteBenchmark
5755

5856
@Benchmark
5957
def testRoute(): Option[Future[Response]] = {
60-
route.handle(postGroupsRequest, postGroupsPath, bypassFilters = false)
58+
route.handle(request = postGroupsRequest, routeParams = Map.empty, bypassFilters = false)
6159
}
6260

6361
@Benchmark
6462
def testRouteWithPathParams(): Option[Future[Response]] = {
65-
routeWithPathParams.handle(postGroups123Request, postGroups123Path, bypassFilters = false)
63+
routeWithPathParams.handle(
64+
request = postGroups123Request,
65+
routeParams = Map("id" -> "123"),
66+
bypassFilters = false)
6667
}
6768

6869
@Benchmark
6970
def testRouteWithUrlEncodedPathParams(): Option[Future[Response]] = {
70-
routeWithPathParams.handle(postGroupsUrlEncodedRequest,
71-
postGroupsUrlEncodedPath, bypassFilters = false)
71+
routeWithPathParams.handle(
72+
request = postGroupsUrlEncodedRequest,
73+
routeParams = Map.empty,
74+
bypassFilters = false)
7275
}
7376
}

benchmarks/src/test/scala/com/twitter/finatra/http/benchmarks/RoutingServiceBenchmark.scala

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,38 @@ import scala.reflect.classTag
1212
* ./sbt 'project benchmarks' 'jmh:run RoutingServiceBenchmark'
1313
*/
1414
@State(Scope.Thread)
15-
class RoutingServiceBenchmark
16-
extends StdBenchAnnotations
17-
with HttpBenchmark {
15+
class RoutingServiceBenchmark extends StdBenchAnnotations with HttpBenchmark {
1816

1917
val routes: Seq[Route] = Seq(
20-
route("/groups/"),
21-
route("/groups/:id"),
22-
route("/tasks/"),
23-
route("/tasks/:id"),
24-
route("/foo/"),
25-
route("/foo/:id"),
26-
route("/users/"),
27-
route("/users/:id")
18+
route("/groups/verified/vip/top10/"),
19+
route("/groups/verified/vip/top10/:id"),
20+
route("/tasks/easy/top10/:id"),
21+
route("/tasks/starter/top10/:id"),
22+
route("/users/test/temp/top10/"),
23+
route("/users/test/temp/top10/:id"),
24+
route("/groups/vip/top10/"),
25+
route("/groups/vip/top10/:id"),
26+
route("/groups/vip/top10/:id/:name"),
27+
route("/foo/bar/baz/top10/"),
28+
route("/foo/bar/baz/:id"),
29+
route("/foo/baz/baz/:name"),
30+
route("/groups/verified/vip/top5/"),
31+
route("/groups/verified/vip/top5/:id"),
32+
route("/tasks/easy/top5/:id"),
33+
route("/tasks/starter/top5/:id"),
34+
route("/users/test/temp/top5/"),
35+
route("/users/test/temp/top5/:id"),
36+
route("/groups/vip/top5/"),
37+
route("/groups/vip/top5/:id"),
38+
route("/groups/vip/top5/:id/:name"),
39+
route("/foo/bar/baz/top5/"),
40+
route("/foo/bar/baz/top5/:id"),
41+
route("/foo/baz/baz/top5/:name")
2842
)
2943

3044
val routingService: RoutingService = new RoutingService(routes)
31-
val getRequest1: Request = Request("/users/")
32-
val getRequest2: Request = Request("/users/123")
45+
val getRequest1: Request = Request("/foo/bar/baz/top5/")
46+
val getRequest2: Request = Request("/groups/vip/top5/123/jack")
3347

3448
@Benchmark
3549
def timeOldLastConstant(): Future[Response] = {

build.sbt

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import scoverage.ScoverageKeys
44
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1)
55

66
// All Twitter library releases are date versioned as YY.MM.patch
7-
val releaseVersion = "19.8.0"
7+
val releaseVersion = "19.9.0"
88

99
lazy val buildSettings = Seq(
1010
version := releaseVersion,
1111
scalaVersion := "2.12.8",
1212
crossScalaVersions := Seq("2.11.12", "2.12.8"),
1313
scalaModuleInfo := scalaModuleInfo.value.map(_.withOverrideScalaVersion(true)),
14-
fork in Test := true,
14+
fork in Test := true, // We have to fork to get the JavaOptions
1515
javaOptions in Test ++= travisTestJavaOptions
1616
)
1717

@@ -23,13 +23,29 @@ lazy val noPublishSettings = Seq(
2323
publishTo := Some(Resolver.file("Unused transient repository", file("target/unusedrepo")))
2424
)
2525

26+
def gcJavaOptions: Seq[String] = {
27+
Seq(
28+
"-XX:+UseParNewGC",
29+
"-XX:+UseConcMarkSweepGC",
30+
"-XX:+CMSParallelRemarkEnabled",
31+
"-XX:+CMSClassUnloadingEnabled",
32+
"-XX:ReservedCodeCacheSize=128m",
33+
"-XX:SurvivorRatio=128",
34+
"-XX:MaxTenuringThreshold=0",
35+
"-Xss8M",
36+
"-Xms512M",
37+
"-Xmx2G"
38+
)
39+
}
40+
2641
def travisTestJavaOptions: Seq[String] = {
2742
// When building on travis-ci, we want to suppress logging to error level only.
43+
// https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
2844
val travisBuild = sys.env.getOrElse("TRAVIS", "false").toBoolean
2945
if (travisBuild) {
3046
Seq(
3147
"-DSKIP_FLAKY=true",
32-
"-Dsbt.log.noformat=true",
48+
"-DSKIP_FLAKY_TRAVIS=true",
3349
"-Dorg.slf4j.simpleLogger.defaultLogLevel=error",
3450
"-Dcom.twitter.inject.test.logging.disabled",
3551
// Needed to avoid cryptic EOFException crashes in forked tests
@@ -107,6 +123,12 @@ lazy val baseSettings = Seq(
107123
scalaCompilerOptions,
108124
javacOptions in (Compile, compile) ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint:unchecked"),
109125
javacOptions in doc ++= Seq("-source", "1.8"),
126+
javaOptions ++= Seq(
127+
"-Djava.net.preferIPv4Stack=true",
128+
"-XX:+AggressiveOpts",
129+
"-server"
130+
),
131+
javaOptions ++= gcJavaOptions,
110132
// -a: print stack traces for failing asserts
111133
testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"),
112134
// broken in 2.12 due to: https://issues.scala-lang.org/browse/SI-10134
@@ -517,8 +539,7 @@ lazy val injectUtils = (project in file("inject/inject-utils"))
517539
moduleName := "inject-utils",
518540
libraryDependencies ++= Seq(
519541
"com.twitter" %% "finagle-core" % versions.twLibVersion,
520-
"com.twitter" %% "util-core" % versions.twLibVersion,
521-
"commons-lang" % "commons-lang" % versions.commonsLang
542+
"com.twitter" %% "util-core" % versions.twLibVersion
522543
)
523544
).dependsOn(
524545
injectCore % "test->test;compile->compile")

doc/src/sphinx/exts/includecode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run(self):
5353
encoding = self.options.get('encoding', env.config.source_encoding)
5454
codec_info = codecs.lookup(encoding)
5555
try:
56-
f = codecs.StreamReaderWriter(open(fn, 'U'),
56+
f = codecs.StreamReaderWriter(open(fn, 'Ub'),
5757
codec_info[2], codec_info[3], 'strict')
5858
lines = f.readlines()
5959
f.close()

0 commit comments

Comments
 (0)