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
Mockito 2.6.4 hangs on JDK 1.8.0_31 #892
Comments
@Stephan202 Thanks for filling the issue. There's plenty of bugs with JDK8 prior to u45 that affected Mockito. The first working version of the JDK is u45 it we don't support earlier buggy version of the JDK. This issue is different though, I don't know if there's enough life throughput for this bug, especially given the issue is resolved with later version of the JDK. |
Do you have some special setup in your class loaders? I wonder how this could even relate to the update, there should not be a race to loading these classes. Also, nowhere in Byte Buddy, |
Travis runs on a newer version for the non-dockerized build: travis-ci/travis-ci#3259 (comment) - It is really a pitty how far behind Travis is in this regard, but I am afraid there is little we can do here. |
@Stephan202 Could it be related to Azure libraries ? I saw a |
@raphw Yes @travis-ci is disappointing in this regard... |
@bric3, you were onto something. When I disable the two tests that mock public interface ServiceBusContract extends
JerseyFilterableService<ServiceBusContract> {
...
} @raphw, might that be related? |
Hey Stephan, you might be on to something, even though Byte Buddy resolves generic types lazily to support generic types. I will have a look and see if I can reproduce something. |
@Stephan202 I tried to reproduce your bug by running a u31 version, mocking the Could you:
I wonder if we should not lock the class for the cache but be a bit more granular by locking the class' loader instead. We might be competing with other threads where a custom class loader locks the class as a class loader lock. In the end, we do not really know how they are implemented. For investigating this, knowing at least (1) would be very helpful. |
@raphw, I created a Gist with a reproduction case: https://gist.github.com/Stephan202/2a1650945c2c633217d4f30f89e4412e (the For this reproduction case, the full thread details for the relevant two threads are:
|
Fix TypeCache dead lock Should fix #892
@raphw, thanks! I've tested with version 2.6.8 and can confirm the fix works. |
This bug was really tricky. @raphw and @bric3 THANK you for being super fast in reacting to issues reported by our users. It's a pleasure working on open source together 🥇 @Stephan202, thank you for confirming the bug is fixed and reporting this issue diligently. It is very helpful to us when we get comprehensive bug reports such as this one. |
We just upgraded to Mockito 2.6.4. When we run our tests on Travis CI without the
oracle-java8-installer
, JDK 1.8.0_31 is used. We then have two threads hanging in the following state:The issue reported here does not reproduce with Mockito 2.6.3. It also does not reproduce with JDK 1.8.0_121. I assume it's caused by #891.
(I know upgrading our JDK would be "better", but if at all possible I'd like to see this fixed anyway, because using the
oracle-java8-installer
introduces a dependency on the Oracle website, and we've seen it being down from time-to-time, thus affecting our build stability.)CC @raphw. (If you want me to file such tickets directly against Byte Buddy, let me know.)
The text was updated successfully, but these errors were encountered: