KAFKA-6846: Throw InterruptedException after poll in awaitReady() and sendAndReceive() if the interrupt flag is set
This PR resolves the issue that controller can spend a long time (more than 60s) in processing BrokerChange event when there are dead brokers, by throwing InterruptedException in the right place if the RequestSendThread sees the interrupt flag is set. In this case, RequestSendThread can break the poll loop before timeout to finish the shutdown and unblock the controller event thread, who is waiting for RequestSendThread to shutdown when removing the broker.
Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
Thanks for the patch. LGTM overall. Can we add a unit test?
@becketqin Thanks for the review. I have added a unit test and update the PR. Could you take a look again?
@becketqin Ping Becket for review. Thanks!
@hachikuji Thanks for your review. I have updated the PR to address all the comments.
This PR is being marked as stale since it has not had any activity in 90 days. If you would like to keep this PR alive, please leave a comment asking for a review. If the PR has merge conflicts, update it with the latest from the base branch.
If you are having difficulty finding a reviewer, please reach out on the [mailing list](https://kafka.apache.org/contact).
If this PR is no longer valid or desired, please feel free to close it. If no activity occurs in the next 30 days, it will be automatically closed.
This PR has been closed since it has not had any activity in 120 days. If you feel like this was a mistake, or you would like to continue working on it, please feel free to re-open the PR and ask for a review.