Skip to content

Modify cloudwatch sink to use FixedThreadPool#5770

Merged
kkondaka merged 2 commits into
opensearch-project:mainfrom
kkondaka:threadpool-fix
Jun 11, 2025
Merged

Modify cloudwatch sink to use FixedThreadPool#5770
kkondaka merged 2 commits into
opensearch-project:mainfrom
kkondaka:threadpool-fix

Conversation

@kkondaka

Copy link
Copy Markdown
Collaborator

Description

Modify cloudwatch sink to use FixedThreadPool. The existing newCachedThreadPool() creates huge amount of threads (leading to out of memory error in some cases) when there is large amount of events created.

Modified the code to use newFixedThreadPool().

Issues Resolved

Resolves #[Issue number to be closed when this PR is merged]

Check List

  • [ X] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • [X ] Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>
@Max(15)
private int maxRetries = DEFAULT_RETRY_COUNT;

@JsonProperty(value = "num_threads", defaultValue = "10")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should we call this workers like we do in other cases.

Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>
@kkondaka kkondaka merged commit fc20c56 into opensearch-project:main Jun 11, 2025
46 of 51 checks passed
jeffreyAaron pushed a commit to jeffreyAaron/data-prepper that referenced this pull request Jun 13, 2025
* Modify cloudwatch sink to use FixedThreadPool

Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>

* Addressed comments

Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>

---------

Signed-off-by: Krishna Kondaka <krishkdk@amazon.com>
Signed-off-by: Jeffrey Aaron Jeyasingh <jeffreyaaron06@gmail.com>
@kkondaka kkondaka deleted the threadpool-fix branch July 1, 2025 17:04
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.

3 participants