mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 04:26:57 +00:00
Concurrency issues in search (#23249)
* Fix - 23213 : WebSocketManager Issue on concurrent modification * Await till consumers comelete the job --------- Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
This commit is contained in:
parent
2fb41687d2
commit
080f0d21fb
@ -756,10 +756,9 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
||||
|
||||
private void waitForConsumersToComplete(CountDownLatch consumerLatch)
|
||||
throws InterruptedException {
|
||||
boolean finished = consumerLatch.await(5, TimeUnit.MINUTES);
|
||||
if (!finished) {
|
||||
LOG.warn("Consumers did not finish within timeout");
|
||||
}
|
||||
LOG.info("Waiting for all consumers to complete their work...");
|
||||
consumerLatch.await(); // Wait indefinitely for consumers to finish all work
|
||||
LOG.info("All consumers have completed their work");
|
||||
}
|
||||
|
||||
private void handleInterruption(InterruptedException e) throws InterruptedException {
|
||||
|
||||
@ -108,7 +108,7 @@ public class WebSocketManager {
|
||||
userSocketConnections =
|
||||
activityFeedEndpoints.containsKey(id)
|
||||
? activityFeedEndpoints.get(id)
|
||||
: new HashMap<>();
|
||||
: new ConcurrentHashMap<>();
|
||||
userSocketConnections.put(socket.getId(), socket);
|
||||
activityFeedEndpoints.put(id, userSocketConnections);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user