Skip to content
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

Fix bug where process worker would shut down if a processor drops all… #4262

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

graytaylor0
Copy link
Member

@graytaylor0 graytaylor0 commented Mar 11, 2024

… events

Description

This change fixes a bug where

Recreating

  1. Create a pipeline with two processors, where the first drops all events
processor:
   - drop_events:
         drop_when: true
   - add_entries:
         ....
  1. Observe the error and shut down of the process worker
ERROR org.opensearch.dataprepper.pipeline.ProcessWorker - Encountered exception during pipeline log-pipeline processing
java.lang.ClassCastException: class java.util.Collections$EmptyList cannot be cast to class java.util.ArrayList (java.util.Collections$EmptyList and java.util.ArrayList are in module java.base of loader 'bootstrap')
	at org.opensearch.dataprepper.pipeline.ProcessWorker.doRun(ProcessWorker.java:132) ~[data-prepper-core-2.7.0-SNAPSHOT.jar:?]
	at org.opensearch.dataprepper.pipeline.ProcessWorker.run(ProcessWorker.java:62) [data-prepper-core-2.7.0-SNAPSHOT.jar:?]
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.base/java.lang.Thread.run(Thread.java:829) [?:?]

Issues Resolved

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

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • 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.

kkondaka
kkondaka previously approved these changes Mar 11, 2024
oeyh
oeyh previously approved these changes Mar 11, 2024
kkondaka
kkondaka previously approved these changes Mar 11, 2024
… events

Signed-off-by: Taylor Gray <tylgry@amazon.com>
oeyh
oeyh previously approved these changes Mar 11, 2024
dlvenable
dlvenable previously approved these changes Mar 11, 2024
@dlvenable
Copy link
Member

@graytaylor0 , It would be ideal to have a unit test which tests against an empty list since that is the exact cause of the bug.

Signed-off-by: Taylor Gray <tylgry@amazon.com>
@graytaylor0 graytaylor0 dismissed stale reviews from dlvenable and oeyh via 9568920 March 11, 2024 22:38
@graytaylor0 graytaylor0 merged commit ed3f75e into opensearch-project:main Mar 12, 2024
46 of 47 checks passed
@graytaylor0 graytaylor0 deleted the AckFix branch March 12, 2024 15:48
@dlvenable dlvenable added this to the v2.7 milestone Mar 12, 2024
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.

None yet

4 participants