feign icon indicating copy to clipboard operation
feign copied to clipboard

How to retry SocketTimeoutException?

Open almson opened this issue 2 months ago • 0 comments

This is a rhetorical question. Feign hard-codes which exceptions it considers retryable, and IOExceptions are never retried. Which is incredibly stupid, because I/O exceptions are the main reason to retry network requests! Additionally, IOExceptions are never sent to the errorDecoder and there's almost nothing that can be done to retry them.

Feign seems so nice, but it's poorly thought through. I've had to rewrite half the classes to fix various major annoyances and oversights. Other examples include the logger class splitting each request/response over many log messages (ignoring the various ways logs are shipped and stored), the jackson decoder trying to decode byte[] and String (making it unusable as a default decoder), and now this. Btw, I worked around this issue via a custom decoder that catches IOExceptions, but this likely isn't a complete solution.

almson avatar Oct 09 '25 10:10 almson