Skip to content

Fix potential memory leak when using ReadBodyRoutePredicateFactory#3465

Closed
qnnn wants to merge 6 commits intospring-cloud:mainfrom
qnnn:main
Closed

Fix potential memory leak when using ReadBodyRoutePredicateFactory#3465
qnnn wants to merge 6 commits intospring-cloud:mainfrom
qnnn:main

Conversation

@qnnn
Copy link
Copy Markdown
Contributor

@qnnn qnnn commented Jul 19, 2024

In ReadBodyRoutePredicateFactory, when the predicate for the request body is not matched and none of the remaining Route predicates are matched, the CACHED_REQUEST_BODY_ATTR in the attributes is not cleared. This can lead to memory leaks.

@pivotal-cla
Copy link
Copy Markdown

@qnnn Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link
Copy Markdown

@qnnn Thank you for signing the Contributor License Agreement!

@qnnn
Copy link
Copy Markdown
Contributor Author

qnnn commented Sep 6, 2024

I have updated my code to place the clearCachedRequestBody after the route is not found, to avoid the issue where it might not be cleared after hitting other handle mappings.

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

Labels

Projects

No open projects
Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants