-
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
Clean up discarded response message content on the service side #2671
Conversation
@Override | ||
public void onExchangeFinally() { | ||
if (requestMetaData != null && responseMetaData != null) { | ||
Boolean subscribed = requestMetaData.context().get(payloadSubscribedKey); |
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.
if a retry occurs the request context map state will be shared, do we reset this state anywhere?
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.
That's a great question. Can you help me understand / simulate a case where a retry would happen on the Service side during the response flow in the filters?
I added a test for a pure "error" case as well, but I think what you are suggesting is slightly different.
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.
ah server side retries are less likely but in principal could be done by inserting a filter that has a fallback to in-memory publisher if failure occurs.
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.
Added a test in the latest changeset.
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.
Approach lgtm, my comments only for details of the impl:
servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultHttpServerBuilder.java
Outdated
Show resolved
Hide resolved
servicetalk-http-netty/src/main/java/io/servicetalk/http/netty/DefaultHttpServerBuilder.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpPayloadDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpPayloadDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...tp-netty/src/main/java/io/servicetalk/http/netty/HttpPayloadDiscardCleanerServiceFilter.java
Outdated
Show resolved
Hide resolved
...ttp-netty/src/test/java/io/servicetalk/http/netty/HttpServicePayloadDiscardWatchdogTest.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpPayloadDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...ttp-netty/src/test/java/io/servicetalk/http/netty/HttpServicePayloadDiscardWatchdogTest.java
Outdated
Show resolved
Hide resolved
...ttp-netty/src/test/java/io/servicetalk/http/netty/HttpServicePayloadDiscardWatchdogTest.java
Outdated
Show resolved
Hide resolved
...ttp-netty/src/test/java/io/servicetalk/http/netty/HttpServicePayloadDiscardWatchdogTest.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.
LGTM after the last comments:
...c/main/java/io/servicetalk/http/netty/HttpMessageDiscardCleanerServiceLifecycleObserver.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpMessageDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpMessageDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...p-netty/src/main/java/io/servicetalk/http/netty/HttpMessageDiscardWatchdogServiceFilter.java
Outdated
Show resolved
Hide resolved
...c/main/java/io/servicetalk/http/netty/HttpMessageDiscardCleanerServiceLifecycleObserver.java
Outdated
Show resolved
Hide resolved
...ttp-netty/src/test/java/io/servicetalk/http/netty/HttpMessageDiscardWatchdogServiceTest.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!
No description provided.