Idempotent producer ignores shutdown while fetching ProducerId
Check `running` in `Sender.maybeWaitForProducerId` to ensure that the producer can be closed while awaiting initialization of the producerId.
Reviewers: Jason Gustafson
@@ -494,7 +494,7 @@ public class Sender implements Runnable {
}
private void maybeWaitForProducerId() {
- while (!transactionManager.hasProducerId() && !transactionManager.hasError()) {
+ while (running && !transactionManager.hasProducerId() && !transactionManager.hasError()) {
Node node = null;
try {
node = awaitLeastLoadedNodeReady(requestTimeoutMs);
