-
Notifications
You must be signed in to change notification settings - Fork 652
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
Global resource cleanup slow on Mac OS #860
Comments
@sbrannen There is a problem with the test When you initialise the Here is the code, you enter in the When we dispose the event loop group we invoke |
The log below is an execution on Ubuntu - again
|
Oops. That's actually my fault: I missed that the Thanks for finding that! I've fixed that now.
I've moved our "destroy" invocation to an This is acceptable and much better than the 122 seconds we were seeing. However, is it possible to override the default quiet period and timeout? At a glance, it looks like |
Prior to this commit, the parameterized DataBufferFactory was never actually used when setting up the WebClient for each test. This was due to an oversight when migrating from JUnit 4 to JUnit Jupiter. See: reactor/reactor-netty#860 This commit fixes this by converting the existing @beforeeach method to a local setup method that is invoked from each @ParameterizedDataBufferAllocatingTest method. In addition, in order to avoid the 2 second "quiet period" that is incurred when destroying the ReactorResourceFactory, this commit moves the setup and destruction of the ReactorResourceFactory to new @BeforeAll and @afterall methods. The test instance lifecycle has also been switched to PER_CLASS to avoid static state in the test class.
@sbrannen we can expose an API and then use https://netty.io/4.1/api/io/netty/util/concurrent/EventExecutorGroup.html#shutdownGracefully-long-long-java.util.concurrent.TimeUnit- |
Closing since the bug in Spring's test suite has been fixed in spring-projects/spring-framework@38052e7. |
I think it would be nice to make that configurable. Feel free to reopen this issue if you decide to go that route. Thanks again for your support! 👍 |
Reopen - we may expose an API with quiet period and timeout |
I'd like to have this feature in 0.9.x is it possible to provide it? We discussed it on gitter @violetagg . |
Thanks for adding this support, @violetagg! Looking forward to updating our tests once we're on Do you know which |
@sbrannen the planning is |
Overview
When using global HTTP resources for event loops and pooling on Mac OS, cleanup of those resources takes considerably longer on Mac OS than it does on Linux.
For example, after this commit in the Spring Framework, the WebClientDataBufferAllocatingTests test class began taking approximately 120 seconds instead of 2-3 seconds to complete.
After disabling the use of global resources in spring-projects/spring-framework@f0e160f#diff-cb71838b5a4c0062d77075023316ea9c, the
WebClientDataBufferAllocatingTests
test class once again completes in 2-3 seconds.Based on a tip from a colleague that including a dependency on
io.netty:netty-transport-native-kqueue:4.1.39.Final:osx-x86_64
might help, I tried that in thespring-webflux
project, but that does not appear to make a difference.Expected Behavior
The time taken for blocking global resource cleanup on Mac OS is comparable to cleanup on Linux.
Actual Behavior
The time taken for blocking global resource cleanup on Mac OS is considerably slower than on Linux.
Steps to Reproduce
Execute the
WebClientDataBufferAllocatingTests
test class withthis.factory.setUseGlobalResources(false);
commented out in thesetUp()
method.Your Environment
The text was updated successfully, but these errors were encountered: