How to handle "unexpected EOF"?

I am seeing an occasional error entry that says:

time="2022-10-21T13:04:01Z" level=debug msg="'502 Bad Gateway' caused by: readfrom tcp> unexpected EOF""

The key is that it is causing 502 Bad Gateway errors.

I suspect that this happens because the target is shutting down midst an inbound request, although I would expect this to be handled more gracefully, given that we signal that Pods are not ready and give 30 seconds grace period.

Assuming above is the case: What's the correct way to handle this? Is it valid use case to use the retry middleware here?