OpenFeign / OpenFeign/feign

How to retry SocketTimeoutException?

Open
#3,074 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug question
Dominant language
Java
Stars
9.8k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
41

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing Feign's retryable-exception handling and how IOExceptions reach the errorDecoder; the issue names no files or tests. Compare the existing custom-decoder workaround with the desired retry behavior, and define done only after maintainers clarify which exceptions and configuration should be supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.