-
Notifications
You must be signed in to change notification settings - Fork 25.7k
TESTS: Remove Static Threadpool in TaskManagerTest #36976
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
Conversation
* The static threadpool leaks a lot of memory in these tests because it prevents things like the connect listeners from `org.elasticsearch.transport.TcpTransport#initiateConnection` to be GCed between tests (since they keep being referenced by the threadpool) which in turn reference channels and their underlying buffers * I could not find any slowdown in executing these tests from this change, if anything they are slightly faster now on my machine * Relates #36906 (which may be caused by slowness from leaking memory and also becomes testable in a loop by this change)
|
Pinging @elastic/es-core-infra |
| public abstract class TaskManagerTestCase extends ESTestCase { | ||
|
|
||
| protected static ThreadPool threadPool; | ||
| public static final Settings CLUSTER_SETTINGS = Settings.builder().put("cluster.name", "test-cluster").build(); |
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 was just unused
|
Jenkins run gradle build tests 2 please |
|
Jenkins run gradle build tests 1 please |
danielmitterdorfer
left a comment
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.
LGTM
|
@danielmitterdorfer thanks! |
|
This appears to be causing test failures in |
|
@romseygeek looking into it. |
|
@romseygeek Fixed in #37123 |
* If the threadpool gets shut down before the testnodes we run into an error => fixed by moving to single `After` method * Relates #36976
* The static threadpool leaks a lot of memory in these tests because it prevents things like the connect listeners from `org.elasticsearch.transport.TcpTransport#initiateConnection` to be GCed between tests (since they keep being referenced by the threadpool) which in turn reference channels and their underlying buffers * I could not find any slowdown in executing these tests from this change, if anything they are slightly faster now on my machine * Relates #36906 (which may be caused by slowness from leaking memory and also becomes testable in a loop by this change)
* If the threadpool gets shut down before the testnodes we run into an error => fixed by moving to single `After` method * Relates #36976
org.elasticsearch.transport.TcpTransport#initiateConnectionto be GCed between tests (since they keep being referenced by the threadpool) which in turn reference channels and their underlying buffers