-
Notifications
You must be signed in to change notification settings - Fork 85
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
Preview of upgrade to Scala 2.12. #342
Conversation
ghost
commented
Feb 21, 2017
•
edited by ghost
Loading
edited by ghost
- Incremented all required versions to value that included scala 2.12 support. See diff for details.
- Modified RedisStore to use Buf instead of ChannelBuffer due to changes in underlying client. To ease this transition a method to convert Store[Buf, Buf] to Store[ChannelBuffer, ChannelBuffer] is provided on RedisStore.
- Removed support for Scala 2.10. Two libraries lacked support for scala 2.10 and 2.12 on the same version: twiiter-util and finagle. Supporting 2.10 finagle and 2.12 finagle was not possible due to interface changes.
- Various packages changed and were fixed.
- Added target to travis.yml and build.sbt to include scala 2.12.
- Set source and build target to java 8 to support scala 2.12.
I had some trouble getting the tests to run consistently on travis.ci. When I ran the tests locally against each data-store running in docker everything worked. Noticed the mongo-db tests create ~10k connections during the test run this seemed to be part of why travis has trouble with the build. |
Nice, this would solve #310 as well 👍 |
@@ -227,9 +230,8 @@ lazy val storehausMemcache = module("memcache").settings( | |||
"com.twitter" %% "bijection-core" % bijectionVersion, | |||
"com.twitter" %% "bijection-netty" % bijectionVersion, | |||
"com.twitter" %% "finagle-memcached" % finagleVersion excludeAll( | |||
// we don't use this and its not on maven central. | |||
ExclusionRule("com.twitter.common.zookeeper"), | |||
ExclusionRule("com.twitter.common") |
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.
Part of the upgraded finagle memcache client needed com.twitter.common.metrics.Gauge so this exclude was removed.
build.sbt
Outdated
val algebirdVersion = "0.12.0" | ||
val bijectionVersion = "0.9.1" | ||
val utilVersion = "6.34.0" | ||
val algebirdVersion = "0.12.4" |
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.
this should be 0.13.0
build.sbt
Outdated
@@ -322,7 +324,7 @@ lazy val storehausTesting = Project( | |||
settings = sharedSettings ++ Seq( | |||
name := "storehaus-testing", | |||
libraryDependencies ++= Seq( | |||
"org.scalacheck" %% "scalacheck" % "1.12.2" withSources(), | |||
"org.scalacheck" %% "scalacheck" % "1.12.6" withSources(), |
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.
can we go to 1.13
branch? Also, while we are at it, can we move this version up to the top of the file where we set the other versions?
@johnynek is the general preference to be on the max version of each lib? I set the versions to the min available. |
The general preference is to be on the minimum version that gives us what we need, that is also binary compatible with the latest version. Consumers of this library can then set. For scalacheck, 1.13 has some significantly better features (better Function generation, and I thought was needed for 2.12). |
Great. Thanks for that guidance. I will go back over the versions set here to make sure everything is aligned with that. |
Looking at the travis ci failure it might be that the level of concurrency is too high for mysql and the other stores to handle during these property tests. |
@ben-adazza - Published the 2.12 friendly version of Scalding - 0.17.0. Can you try and pick that up in your PR? |
build.sbt
Outdated
val utilVersion = "6.39.0" | ||
|
||
//Scalding is not yet on scala 12 so this needs to be | ||
// rev'ed to get the PR to compile for 12. | ||
val scaldingVersion = "0.16.0-RC1" |
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.
can upgrade to 0.17.0
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.
Excellent. I will do that right away. Thanks!
1. Incremented all required versions to value that included scala 2.12 support. See diff for details. 2. Modified RedisStore to use Buf instead of ChannelBuffer due to changes in underlying client. To ease this transition a method to convert Store[Buf, Buf] to Store[ChannelBuffer, ChannelBuffer] is provided on RedisStore. 3. Removed support for Scala 2.10. Two libraries lacked support for scala 2.10 and 2.12 on the same version: twiiter-util and finagle. Supporting 2.10 finagle and 2.12 finagle was not possible due to interface changes. 4. Various packages changed and were fixed. 5. Added target to travis.yml and build.sbt to include scala 2.12. 6. Set source and build target to java 8 to support scala 2.12.
script: umask 0022 && ./sbt ++$TRAVIS_SCALA_VERSION clean coverage test coverageReport mimaReportBinaryIssues | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) | ||
# - scala: 2.12.1 |
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.
we can uncomment this now right?
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.
I think we dont need to run coverage (as we're doing this for 2.11) and mima (as this will be the first 2.12 build).
Took a quick look and it seems like a bunch of our mysql tests are failing due to:
|
Yeah. I think the properties tests create 10s of thousands on of connections since they throw away an entire client after each test. |
@ben-adazza yeah we either need to update them to close the connection or set the mysql connection limits higher - https://dev.mysql.com/doc/refman/5.7/en/too-many-connections.html |
Likely a change to the underlying implementation in finagle-mysql. |
val utilVersion = "6.39.0" | ||
|
||
val scaldingVersion = "0.17.0" | ||
val finagleVersion = "6.41.0" |
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.
think the latest version is 6.43.0. Let's use that?
@ben-adazza so looking at the example listed in the finagle-mysql repo: https://github.com/twitter/finagle/blob/master/finagle-example/src/main/scala/com/twitter/finagle/example/mysql/Example.scala#L45 |
I'm able to repro the mysql test failure on my machine. Something that worked for me is sharing a client across tests. But client is not thread safe, so I also had to put the invocations in a synchronized block. Here's the patch:
|
@ben-adazza btw are you still interested in pursuing this PR? I need to upgrade storehaus to scala 2.12 urgently, so I'm happy to take over this work in another PR if needed. Of course really appreciate the work you've already done. Happy to help in any way to get this upgrade shipped. |
@pankajroark by all means you can take this code and get the tests running. Debugging these tests is not high on my priority list right now. |
Fyi: the thing that directly breaks the mysql test is scalacheck update. But the fundamental problem is that the test doesn't close the client. Client can be closed only after the property is used in the tests. I'm trying to find a hook that executes after a property is done testing, to put the client close code there. |
This work was very kindly taken over in: https://github.com/twitter/storehaus/pull/346/files |