Skip to content

fix: netty mem leak during failure - #521

Open
ShubhamChaturvedi7 wants to merge 4 commits into
mainfrom
scchatur/MemLeakFix
Open

ShubhamChaturvedi7 wants to merge 4 commits into
mainfrom
scchatur/MemLeakFix

Conversation

@ShubhamChaturvedi7

Copy link
Copy Markdown

Issue #, if available:

Description of changes:
Drain the stream if a failure has occurred after fetching the payload.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

@ShubhamChaturvedi7
ShubhamChaturvedi7 requested a review from a team as a code owner September 15, 2026 22:10
throw new S3EncryptionClientException("Decryption materials cannot be null. " +
"This may be caused by a misconfigured custom CMM implementation or " +
"a suppressed exception from metadata decoding or CMM invocation due to a network failure.");
// Decryption setup failed in onResponse. AsyncStreamingResponseHandler#onHeaders already

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we are no longer throwing this exception, how are we notifying to custoer that the decryption materials are null and that they may have a misconfigured cmm? removing this exception can be a breaking change, no?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments explain that - since this is async pipeline, a prev step failed and the Future has exception set. Throwing from here doesn't throw it for the callers, but rather for the pipeline. Which is exactly what was causing the memory leak.

TLDR: The caller still sees the exception - see the test case here

This branch has not been deployed

No deployments
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.

2 participants