Skip to content

Fix timer and client leak in OpenSearch JSONResourceWrapper#1866

Merged
jnioche merged 2 commits intomainfrom
fix-json-resource-wrapper-leak
Apr 2, 2026
Merged

Fix timer and client leak in OpenSearch JSONResourceWrapper#1866
jnioche merged 2 commits intomainfrom
fix-json-resource-wrapper-leak

Conversation

@jnioche
Copy link
Copy Markdown
Contributor

@jnioche jnioche commented Apr 2, 2026

Summary

  • The Timer and RestHighLevelClient were created inside an anonymous TimerTask with no way to cancel or close them — the timer thread runs forever and the client's connection pool is never shut down
  • Store both as instance fields and override cleanup() to cancel the timer and close the client
  • cleanup() is called by ParseFilters during bolt cleanup, so this is properly wired in

Test plan

  • Verify compilation with mvn compile -pl external/opensearch -am
  • Verify existing OpenSearch integration tests pass

🤖 Generated with Claude Code

The Timer and RestHighLevelClient were created inside an anonymous TimerTask
with no way to cancel or close them. The timer thread runs forever and the
client's connection pool is never shut down.

Store both as instance fields and override cleanup() to cancel the timer and
close the client. cleanup() is called by ParseFilters during bolt cleanup.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jnioche jnioche added the core label Apr 2, 2026
@jnioche jnioche added this to the 3.5.2 milestone Apr 2, 2026
@rzo1 rzo1 added the bug label Apr 2, 2026
@rzo1
Copy link
Copy Markdown
Contributor

rzo1 commented Apr 2, 2026

Needs checkstyle

Signed-off-by: Julien Nioche <julien@digitalpebble.com>
@jnioche jnioche merged commit 29d3c26 into main Apr 2, 2026
2 checks passed
@jnioche jnioche deleted the fix-json-resource-wrapper-leak branch April 2, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants