Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.sql.Driver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
Expand Down Expand Up @@ -279,7 +278,8 @@ public static HAURLInfo getUrlInfo(String url, Properties properties) throws SQL
}
HAURLInfo haurlInfo = new HAURLInfo(name, principal, additionalJDBCParams);
HAGroupInfo info = getHAGroupInfo(url, properties);
URLS.computeIfAbsent(info, haGroupInfo -> new HashSet<>()).add(haurlInfo);
// Multiple threads can concurrently call this code path with the same HAGroupInfo.
URLS.computeIfAbsent(info, haGroupInfo -> ConcurrentHashMap.newKeySet()).add(haurlInfo);
return haurlInfo;
}

Expand Down