Skip to content

Commit

Permalink
Move throwOnIllegalState call to drain queue method to prevent improp…
Browse files Browse the repository at this point in the history
…er error logging during worker shutdown
  • Loading branch information
zachjhum committed Feb 19, 2024
1 parent a5d1c67 commit 62061a2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ private void throwOnIllegalState() {
}

private PrefetchRecordsRetrieved peekNextResult() {
throwOnIllegalState();
return publisherSession.peekNextRecord();
}

Expand Down Expand Up @@ -389,6 +388,7 @@ synchronized void drainQueueForRequests() {
// If there is an event available to drain and if there is at least one demand,
// then schedule it for delivery
if (publisherSession.hasDemandToPublish() && canDispatchRecord(recordsToDeliver)) {
throwOnIllegalState();
subscriber.onNext(recordsToDeliver.prepareForPublish());
recordsToDeliver.dispatched();
lastEventDeliveryTime = Instant.now();
Expand Down

0 comments on commit 62061a2

Please sign in to comment.