For an I/O block on a machine in the ES cluster, how can I set it so that ES returns a 504 timeout and then tries to poll the node to retry

I have a question to ask .
The scenario is that one of the machines in my ES(6.7) cluster is blocked by I/O, which causes the ES request to be blocked as well, thus causing the thread pool resource depletion. I would like to ask whether there is a corresponding solution for this scenario. When I check the source code(RestClient.java), I see that there is a logic to poll cluster nodes, but only for 502,503,504 response code to perform the retry mechanism, but when I/O block, is there a corresponding timeout setting, so that ES can return 504 response code?
Thanks