Skip to content

[fix] avoid infinite loop in Response#isClientAbortException#450

Merged
chadlwilson merged 1 commit into
jruby:masterfrom
thimios:fix-client-abort-infinite-loop
Jul 16, 2026
Merged

[fix] avoid infinite loop in Response#isClientAbortException#450
chadlwilson merged 1 commit into
jruby:masterfrom
thimios:fix-client-abort-infinite-loop

Conversation

@thimios

@thimios thimios commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Related issue

Fixes #449.

Summary

isClientAbortException walks the exception cause chain but never advances it, so each iteration re-reads the same cause and re-assigns the same message. See more details in #449.

The fix

Advance the chain via a separate cause variable, and bound the traversal.

The bound is necessary as a cause chain may be cyclic (a.initCause(b); b.initCause(a) is possible), which would still hang a cause = cause.getCause().

@thimios
thimios marked this pull request as ready for review July 16, 2026 16:29
@thimios
thimios force-pushed the fix-client-abort-infinite-loop branch from 899d884 to aec35a5 Compare July 16, 2026 16:31
@chadlwilson

Copy link
Copy Markdown
Contributor

Thx! This code looks a bit crazy, and I don't understand how it has sat here like this for so long, nor why I have never seen a problem from it myself... 🤔

@chadlwilson
chadlwilson merged commit 9e036ed into jruby:master Jul 16, 2026
12 checks passed
@chadlwilson chadlwilson added this to the 1.2.8 milestone Jul 16, 2026
@thimios
thimios deleted the fix-client-abort-infinite-loop branch July 16, 2026 16:51
@thimios

thimios commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Thx! This code looks a bit crazy, and I don't understand how it has sat here like this for so long, nor why I have never seen a problem from it myself... 🤔

It is very specific circumstances that would trigger the endless loop which we have been experiencing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Response#isClientAbortException can lock a CPU core in an endless loop

2 participants