OpenFeign / OpenFeign/feign

Retry issue after migration to 13.5

Open
#2,689 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi

We use feign-java11 and feign-gson dependencies in our project and after we migrated from 13.1 to 13.5 one of our tests started failing.
This test uses WireMock and verifies that if malformed response is sent to the client then RetryableException is thrown.

extension.stubFor(post(urlEqualTo("/cities")).willReturn(aResponse().withFault(Fault.MALFORMED_RESPONSE_CHUNK)));
assertThrows(RetryableException.class, () -> cityClient.create(city));

In 13.1 this test passed but in 13.5 fails. Our investigation shown that in both Feign versions IOException is thrown but in 13.1 it's correctly caught in SynchronousMethodHandler.executeAndDecode:

java.io.IOException: chunked transfer encoding, state: READING_LENGTH

And in 13.5 it's not caught. The last line that was executed is

cf = sendAsync(req, responseHandler, null, null);

in HttpClientImpl.send

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 with SynchronousMethodHandler.executeAndDecode and HttpClientImpl.send, then compare the IOException handling between Feign 13.1 and 13.5. Reproduce the WireMock MALFORMED_RESPONSE_CHUNK case from the issue and verify that the client again throws RetryableException as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.