Repository navigation
fix: catch only expected IO failures - #2207
efegokdemir wants to merge 2 commits into
Conversation
gnodet-bot
left a comment
There was a problem hiding this comment.
Review
REQUEST_CHANGES
The catch (Exception e) → catch (IOException e) narrowing in read() is the right fix: unexpected RuntimeExceptions should propagate to the caller rather than being silently swallowed as content failures.
However, the same narrowing applied to rewind() exposes a pre-existing control-flow bug that this PR leaves unaddressed:
After the catch block on line 298, execution falls through to return true at line 302 regardless of whether the catch was taken. So when an IOException is caught and lockedSetTerminal(...) marks the stream as terminally failed, the method still returns true — telling Jetty's retry logic that the rewind succeeded. The subsequent retry then reads from a broken, terminated channel instead of bailing out.
The fix: add return false; inside the catch block, or restructure so the method returns false on any failure path.
License checkbox: The Apache License declaration checkbox is unchecked in the PR description. Please tick it before merge.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
gnodet-bot
left a comment
There was a problem hiding this comment.
Re-review after latest commits. Both prior findings are addressed:
- The
rewind()fall-throughreturn truebug is fixed —return falseis now correctly placed inside the catch block, preventing a false success signal when an exception occurs. - Exception narrowing from
ExceptiontoIOExceptionin bothread()andrewind()is appropriate and correct.
This review was generated by an AI agent, Hermès on behalf of @gnodet.
Fixes #1988.
PutTaskRequestContent.read()andrewind()now convert onlyIOExceptioninto terminal content failures. Unexpected runtime exceptions propagate to the caller instead of being hidden as ordinary content failures. Regression tests cover both channel paths.Tests: focused Maven reactor verification passed with JDK 21; 105 Jetty tests passed and 10 were skipped. Spotless check passed with JDK 21.