Skip to content

Commit 91bf1a6

Browse files
committed
Don't block forever in poll when flushing.
1 parent ac574f2 commit 91bf1a6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/producer/base_producer.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,11 @@ where
506506
if ret.is_error() {
507507
return Err(KafkaError::Flush(ret.into()));
508508
} else {
509-
self.poll(&deadline);
509+
if let Deadline::Never = &deadline {
510+
self.poll(Timeout::After(Duration::ZERO));
511+
} else {
512+
self.poll(&deadline);
513+
}
510514
}
511515
}
512516
Ok(())

0 commit comments

Comments
 (0)