Merge branch '3.3.x' into 3.4.x

- SessionEventRegistry doneWaiting if result found

Issue gh-3398
This commit is contained in:
Rob Winch
2025-05-20 12:21:33 -05:00

View File

@@ -38,9 +38,9 @@ public class SessionEventRegistry implements ApplicationListener<AbstractSession
@Override
public void onApplicationEvent(AbstractSessionEvent event) {
String sessionId = event.getSessionId();
this.events.computeIfAbsent(sessionId, (key) -> new ArrayList<>()).add(event);
Object lock = getLock(sessionId);
synchronized (lock) {
this.events.computeIfAbsent(sessionId, (key) -> new ArrayList<>()).add(event);
lock.notifyAll();
}
}
@@ -72,7 +72,7 @@ public class SessionEventRegistry implements ApplicationListener<AbstractSession
lock.wait(waitInMs);
}
long now = System.currentTimeMillis();
doneWaiting = (now - start) >= waitInMs;
doneWaiting = result != null || (now - start) >= waitInMs;
}
return getEvent(sessionId, type);
}