Skip to content

Commit cbd3220

Browse files
pivovaritbsideup
andauthored
Protect NetworkImpl#close from concurrency issues (#2203)
* Increase thread safety of NetworkImpl * un-volatile `id` Co-authored-by: Sergei Egorov <[email protected]>
1 parent 3833ce4 commit cbd3220

File tree

1 file changed

+1
-1
lines changed
  • core/src/main/java/org/testcontainers/containers

1 file changed

+1
-1
lines changed

core/src/main/java/org/testcontainers/containers/Network.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ protected void after() {
9797
}
9898

9999
@Override
100-
public void close() {
100+
public synchronized void close() {
101101
if (initialized.getAndSet(false)) {
102102
ResourceReaper.instance().removeNetworkById(id);
103103
}

0 commit comments

Comments
 (0)