Skip to content

Commit d823afb

Browse files
committed
Increase timeout before closing stream
1 parent ed0f60e commit d823afb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server-common/src/main/java/io/a2a/server/events/EventConsumer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ public Flow.Publisher<EventQueueItem> consumeAll() {
213213
// the stream-end signal can reach the client BEFORE the buffered final event,
214214
// causing the client to close the connection and never receive the final event.
215215
// This is especially important in replicated scenarios where events arrive via Kafka
216-
// and timing is less deterministic. A small delay ensures the buffer flushes.
216+
// and timing is less deterministic. A delay ensures the buffer flushes.
217+
// Increased to 150ms to account for CI environment latency and JVM scheduling delays.
217218
if (isFinalSent) {
218219
try {
219-
Thread.sleep(50); // 50ms to allow SSE buffer flush
220+
Thread.sleep(150); // 150ms to allow SSE buffer flush in CI environments
220221
} catch (InterruptedException e) {
221222
Thread.currentThread().interrupt();
222223
}

0 commit comments

Comments
 (0)