When a query is stopped, `processAllAvailable` may just block forever.
[Github] Pull Request #19314 (zsxwing)