Skip to content

Commit

Permalink
Removal of containers from the cache is not synchronized (#4598)
Browse files Browse the repository at this point in the history
Co-authored-by: Eduard Tomek <eduard.tomek@usu.com>
  • Loading branch information
edee111 and Eduard Tomek authored May 18, 2022
1 parent 5533447 commit ada816c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ private Connection wrapConnection(final Connection connection, final JdbcDatabas
return new ConnectionWrapper(connection, () -> {
finalConnections.remove(connection);
if (!isDaemon && finalConnections.isEmpty()) {
container.stop();
jdbcUrlContainerCache.remove(connectionUrl.getUrl());
synchronized (jdbcUrlContainerCache) {
container.stop();
jdbcUrlContainerCache.remove(connectionUrl.getUrl());
}
}
});
}
Expand Down

0 comments on commit ada816c

Please sign in to comment.