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

Netty warning on startup with Scala 2.12 #581

Closed
daviddenton opened this issue Jan 20, 2017 · 7 comments
Closed

Netty warning on startup with Scala 2.12 #581

daviddenton opened this issue Jan 20, 2017 · 7 comments
Assignees

Comments

@daviddenton
Copy link
Contributor

When using Scala 2.12, Finagle servers fail to start up cleanly (v6.41.0), generating a Netty warning.

Expected behavior

No warnings!

Actual behavior

The following warning is generated after 10 seconds:

INFO: Finagle version 6.41.0 (rev=95eedf5f41f78414fae25d93cc8fae02eeb5a75d) built at 20161220-164650
Jan 04, 2017 7:33:49 PM org.jboss.netty.channel.socket.nio.AbstractNioWorkerPool
WARNING: Failed to get all worker threads ready within 10 second(s). Make sure to specify the executor which has more threads than the requested workerCount. If unsure, use Executors.newCachedThreadPool().

The server seems to behave normally, but I have not placed it under any particularly high load.

Steps to reproduce the behavior

A simple project to reproduce the warning can be found below. There is only a single dependency on finagle-http, and a single source file with an app:

https://github.com/daviddenton/finagle-netty-bug

@chintootech
Copy link

I am getting the same warnings using scala 2.12.1 and finagle 6.41.0.

@vkostyukov
Copy link
Contributor

Thanks @daviddenton for the report! I'll be looking into that this week.

@vkostyukov
Copy link
Contributor

I have an update on this. Seems like there is a problem in Scalac 2.12 w.r.t. to how it compiles this piece of code. Difference in the stack-traces between 2.12- and 2.11-compiled threads lead me to that file. I was trying to figure out what exactly is different between 2.11 and 2.12 but wasn't able to do that yet.

Anyways, there is some good news. Just by running some weird experiments I figure how we could workaround this. TL;DR we need to move those closures (starting with Awaitable.*) out of the class initialization path. Doing this made the warning disappear.

We're thinking about doing a February release so I want to go ahead and apply my workaround such that we make sure to fix this in the upcoming release. In the meantime, I will try to figure out how to reduce the reproducer case so I can report that as a scalac bug.

As a side note. This warning blocks the very first client/server initialization for 10 seconds. I think we should consider this a bug and a blocker for 2.12 adoption in Finagle.

@vkostyukov
Copy link
Contributor

The workaround I've been talking about has been merged (225c86d). I'm going to close this ticket but keep the internal one until the reproducer for Scalac is ready.

Thanks @daviddenton for the report!

@daviddenton
Copy link
Contributor Author

Nice work @vkostyukov ... looks like it was an interesting one to investigate!!

Is there a rough date on the next finagle release for 2.12 (early/late Feb)?

Thanks!

😀

@vkostyukov
Copy link
Contributor

I think @bryce-anderson is going to release Finagle this week.

@vkostyukov
Copy link
Contributor

Just an update on this: I made the reproducer (https://github.com/vkostyukov/scala-2-12-1-and-runnable-bug) and filled a scalac bug (https://issues.scala-lang.org/browse/SI-10169).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants