Skip to content

Commit de9b3a5

Browse files
committed
Use dedicated service executor for configuration connection
We make sure the configuration connection will always have its own executor service, even with several runs, e.g. with PerfTestMulti. Fixes #220 (cherry picked from commit b1b8c4e)
1 parent 64c461f commit de9b3a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/com/rabbitmq/perf/MulticastSet.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,15 @@ public void run(boolean announceStartup)
161161
this.params.getHeartbeatSenderThreads()
162162
);
163163
factory.setHeartbeatExecutor(heartbeatSenderExecutorService);
164+
// use a single-threaded executor for the configuration connection
165+
// this way, a default one is not created and this one will shut down
166+
// when the run ends.
167+
// this can matter when this instance is used for several runs, e.g. with PerfTestMulti
168+
// see https://github.com/rabbitmq/rabbitmq-perf-test/issues/220
169+
ExecutorService executorServiceConfigurationConnection = this.threadingHandler.executorService(
170+
"perf-test-configuration-", 1
171+
);
172+
factory.setSharedExecutor(executorServiceConfigurationConnection);
164173
Connection configurationConnection = createConnection("perf-test-configuration");
165174
MulticastParams.TopologyHandlerResult topologyHandlerResult = params.configureAllQueues(configurationConnection);
166175
enableTopologyRecoveryIfNecessary(configurationConnection, topologyHandlerResult);

0 commit comments

Comments
 (0)