Skip to content
Merged
Show file tree
Hide file tree
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 @@ -179,10 +179,14 @@ public Flow.Publisher<EventQueueItem> consumeAll() {
if (pollTimeoutsAfterAgentCompleted >= MAX_POLL_TIMEOUTS_AFTER_AGENT_COMPLETED) {
LOGGER.debug("Agent completed with {} consecutive poll timeouts and empty queue, closing for graceful completion (queue={})",
pollTimeoutsAfterAgentCompleted, System.identityHashCode(queue));
queue.close();
completed = true;
tube.complete();
return;
if (queue.closeIfNotAwaitingFinalEvent()) {
completed = true;
tube.complete();
return;
}
// A final event started while this consumer was timing out.
// Keep polling until it is distributed or its producer rolls back.
pollTimeoutsAfterAgentCompleted = 0;
} else {
LOGGER.debug("Agent completed but grace period active ({}/{} timeouts), continuing to poll (queue={})",
pollTimeoutsAfterAgentCompleted, MAX_POLL_TIMEOUTS_AFTER_AGENT_COMPLETED, System.identityHashCode(queue));
Expand Down
Loading
Loading