Skip to content
Merged
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 @@ -138,9 +138,12 @@ public void onSubscribe(Subscription s) {
@Override
public void onNext(T t) {
if (!queue.offer(t)) {
// Error must be set first before calling cancel to avoid race
// with hasNext(), which checks for cancel first before checking
// for error.
error = new QueueOverflowException();
SubscriptionHelper.cancel(this);

onError(new QueueOverflowException());
onComplete();
} else {
signalConsumer();
}
Expand Down
Loading