Skip to content

Commit bee238b

Browse files
committed
fix(memory-leak): working with threadpool
Change work with threadpool allocated in stack to work with common pool
1 parent 9890094 commit bee238b

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Bug fixes
6+
7+
- Fix a memory leak due to the use of a local thread pool
8+
59
### Spring-data
610
- Add `tarantool-spring-data-35` module with support for Spring Boot 3.5.x and Spring Data 3.5
711

testcontainers/src/main/java/org/testcontainers/containers/tqe/TQEClusterImpl.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import java.util.Map;
1111
import java.util.concurrent.CompletableFuture;
1212
import java.util.concurrent.CopyOnWriteArrayList;
13-
import java.util.concurrent.Executor;
14-
import java.util.concurrent.Executors;
1513

1614
import org.slf4j.Logger;
1715
import org.slf4j.LoggerFactory;
@@ -71,8 +69,6 @@ public synchronized void stop() {
7169

7270
private static void startParallel(
7371
Map<String, ? extends Startable> containers, TQEConfigurator configurator) {
74-
75-
final Executor executor = Executors.newFixedThreadPool(containers.size());
7672
final List<CompletableFuture<?>> futures = new ArrayList<>(containers.size());
7773
final CopyOnWriteArrayList<Throwable> errors = new CopyOnWriteArrayList<>();
7874

@@ -87,8 +83,7 @@ private static void startParallel(
8783
LOGGER.error("Error starting TQE container [container_name='{}']", name, e);
8884
errors.add(e);
8985
}
90-
},
91-
executor)));
86+
})));
9287

9388
CompletableFuture.allOf(futures.toArray(new CompletableFuture[] {})).join();
9489

0 commit comments

Comments
 (0)