-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http-netty: fix JavaNetSoTimeoutHttpConnectionFilter leak #3043
http-netty: fix JavaNetSoTimeoutHttpConnectionFilter leak #3043
Conversation
8ccfdff
to
38adcda
Compare
38adcda
to
882cec8
Compare
...-netty/src/test/java/io/servicetalk/http/netty/JavaNetSoTimeoutHttpConnectionFilterTest.java
Outdated
Show resolved
Hide resolved
...-netty/src/test/java/io/servicetalk/http/netty/JavaNetSoTimeoutHttpConnectionFilterTest.java
Outdated
Show resolved
Hide resolved
...-netty/src/test/java/io/servicetalk/http/netty/JavaNetSoTimeoutHttpConnectionFilterTest.java
Outdated
Show resolved
Hide resolved
...-netty/src/test/java/io/servicetalk/http/netty/JavaNetSoTimeoutHttpConnectionFilterTest.java
Outdated
Show resolved
Hide resolved
...-netty/src/test/java/io/servicetalk/http/netty/JavaNetSoTimeoutHttpConnectionFilterTest.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the back and forth on the error handling code, got additional context from Scott on chat:
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last comments:
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
...http-utils/src/main/java/io/servicetalk/http/utils/JavaNetSoTimeoutHttpConnectionFilter.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Motivation:
There is a resource leak in the JavaNetSoTimeoutHttpConnectionFilter
rooted in the use of the
ambWith(..)
operator: if the response channelloses the race with the timer the resulting response will be dropped on
the floor along with it's hot
payloadBody()
.Modifications:
Replace the
ambWith
with a custom operator that gives us the abilityto cleanup a losing response while also giving us the correct latching
behavior between cancellation, timeout, and response pathways.