-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Stop retaining transport responses for test-only listener #125163
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
Merged
original-brownbear
merged 14 commits into
elastic:main
from
original-brownbear:stop-retaining-transport-response-past-sending
Mar 21, 2025
Merged
Changes from 3 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3791e17
Stop retaining transport responses for test-only listener
original-brownbear fd49527
bckl
original-brownbear 9897475
Merge remote-tracking branch 'elastic/main' into stop-retaining-trans…
original-brownbear b034274
Merge remote-tracking branch 'elastic/main' into stop-retaining-trans…
original-brownbear d5534c3
Stop retaining transport responses for test-only listener
original-brownbear 681783e
all the way
original-brownbear 79cb99e
Merge branch 'main' into stop-retaining-transport-response-past-sending
DaveCTurner 04cb7d6
Merge remote-tracking branch 'elastic/main' into stop-retaining-trans…
original-brownbear 17c451e
Merge remote-tracking branch 'elastic/main' into stop-retaining-trans…
original-brownbear 4bee100
Merge branch 'drop-outbound-msg' into stop-retaining-transport-respon…
original-brownbear 7a34d93
Merge remote-tracking branch 'origin/stop-retaining-transport-respons…
original-brownbear 835639a
CR: comments
original-brownbear af89489
CR: comments
original-brownbear 410040b
Merge branch 'main' into stop-retaining-transport-response-past-sending
original-brownbear File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,21 +27,17 @@ | |
|
|
||
| abstract class OutboundMessage extends NetworkMessage { | ||
|
|
||
| protected final Writeable message; | ||
|
|
||
| OutboundMessage( | ||
| ThreadContext threadContext, | ||
| TransportVersion version, | ||
| byte status, | ||
| long requestId, | ||
| Compression.Scheme compressionScheme, | ||
| Writeable message | ||
| Compression.Scheme compressionScheme | ||
| ) { | ||
| super(threadContext, version, status, requestId, compressionScheme); | ||
| this.message = message; | ||
| } | ||
|
|
||
| BytesReference serialize(RecyclerBytesStreamOutput bytesStream) throws IOException { | ||
| BytesReference serialize(Writeable message, RecyclerBytesStreamOutput bytesStream) throws IOException { | ||
| bytesStream.setTransportVersion(version); | ||
| bytesStream.skip(TcpHeader.HEADER_SIZE); | ||
|
|
||
|
|
@@ -74,12 +70,12 @@ BytesReference serialize(RecyclerBytesStreamOutput bytesStream) throws IOExcepti | |
| stream.close(); | ||
| } | ||
| } | ||
| final BytesReference message = bytesStream.bytes(); | ||
| final BytesReference msg = bytesStream.bytes(); | ||
| if (zeroCopyBuffer.length() == 0) { | ||
| reference = message; | ||
| reference = msg; | ||
| } else { | ||
| zeroCopyBuffer.mustIncRef(); | ||
| reference = new ReleasableBytesReference(CompositeBytesReference.of(message, zeroCopyBuffer), (RefCounted) zeroCopyBuffer); | ||
| reference = new ReleasableBytesReference(CompositeBytesReference.of(msg, zeroCopyBuffer), (RefCounted) zeroCopyBuffer); | ||
| } | ||
|
|
||
| bytesStream.seek(0); | ||
|
|
@@ -119,7 +115,7 @@ static class Request extends OutboundMessage { | |
| boolean isHandshake, | ||
| Compression.Scheme compressionScheme | ||
| ) { | ||
| super(threadContext, version, setStatus(isHandshake), requestId, adjustCompressionScheme(compressionScheme, message), message); | ||
| super(threadContext, version, setStatus(isHandshake), requestId, adjustCompressionScheme(compressionScheme, message)); | ||
| this.action = action; | ||
| } | ||
|
|
||
|
|
@@ -168,7 +164,7 @@ static class Response extends OutboundMessage { | |
| boolean isHandshake, | ||
| Compression.Scheme compressionScheme | ||
| ) { | ||
| super(threadContext, version, setStatus(isHandshake, message), requestId, compressionScheme, message); | ||
| super(threadContext, version, setStatus(isHandshake, message), requestId, compressionScheme); | ||
| } | ||
|
|
||
| private static byte setStatus(boolean isHandshake, Writeable message) { | ||
|
|
@@ -186,17 +182,7 @@ private static byte setStatus(boolean isHandshake, Writeable message) { | |
|
|
||
| @Override | ||
| public String toString() { | ||
| return "Response{" | ||
| + requestId | ||
| + "}{" | ||
| + isError() | ||
| + "}{" | ||
| + isCompress() | ||
| + "}{" | ||
| + isHandshake() | ||
| + "}{" | ||
| + message.getClass() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather we kept some way to identify the response type, although I must say I never much liked sharing its class here. Could we plumb in the |
||
| + "}"; | ||
| return "Response{" + requestId + "}{" + isError() + "}{" + isCompress() + "}{" + isHandshake() + "}"; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There's no usages of
NetworkMessageleft now either?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.
Right deleted it :)