Skip to content

Remove legacy output concurrency#19003

Open
andrewvc wants to merge 9 commits intomainfrom
remove-legacy-output-concurrency
Open

Remove legacy output concurrency#19003
andrewvc wants to merge 9 commits intomainfrom
remove-legacy-output-concurrency

Conversation

@andrewvc
Copy link
Copy Markdown
Contributor

@andrewvc andrewvc commented Apr 14, 2026

Release notes

The default legacy output strategy is now removed. This should cause no user-facing issues.

What does this PR do?

Removes the legacy output strategy, which used the ancient and long deprecated multi-worker concurrency queue with a per-output queue / threadpool. See #18971 for more detail / analysis.

There is a small non-breaking change in behavior, now when users declare workers => 2 or greater values instead of an exception being thrown they only get a warning. This should not be considered a breaking change since this is something no one could rightly be imagined to depend on.

Why is it important/What is the impact to the user?

Code simplification / cleanup.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • Make sure that running with the workers setting produces no effect
  • Make sure that outputs with undeclared concurrency still work

How to test this PR locally

Confirm the commands / output below

#Try this as-is, and with workers => 1 and workers => 2
bin/logstash -e 'input { generator { count => 10 } } output { pipe { command => "tee teeout" } }'
# View the output
cat teeout 

Related issues

Fixes #18971

@andrewvc andrewvc added the bug label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • run exhaustive tests : Run the exhaustive tests Buildkite pipeline.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Apr 14, 2026

This pull request does not have a backport label. Could you fix it @andrewvc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@andrewvc andrewvc added the backport-skip Skip automated backport with mergify label Apr 15, 2026
@andrewvc andrewvc requested a review from kaisecheng April 15, 2026 19:08
@andrewvc andrewvc marked this pull request as ready for review April 15, 2026 19:08
# Outputs that never declared a concurrency strategy used the now-removed :legacy
# strategy, which accepted a `workers` setting. Strip it so existing configs with
# `workers => 1` don't blow up.
if !self.class.instance_variable_defined?(:@concurrency) && @params.delete("workers")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was on the fence about adding a new @concurrency_explicit boolean to detect this, glad to switch to that approach if reviewers find this pragile.

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.

I would find it simpler to just use the :deprecated => "Extra text for deprecation log" facility already supported by the config mixin.

Comment thread logstash-core/lib/logstash/outputs/base.rb
# Outputs that never declared a concurrency strategy used the now-removed :legacy
# strategy, which accepted a `workers` setting. Strip it so existing configs with
# `workers => 1` don't blow up.
if !self.class.instance_variable_defined?(:@concurrency) && @params.delete("workers")
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.

I would find it simpler to just use the :deprecated => "Extra text for deprecation log" facility already supported by the config mixin.

# strategy, which accepted a `workers` setting. Strip it so existing configs with
# `workers => 1` don't blow up.
if !self.class.instance_variable_defined?(:@concurrency) && @params.delete("workers")
self.logger.warn("Output plugin #{self.class.name}: the `workers` setting is no longer used and will be removed in a future release.")
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.

if we do our own logging, we should use the deprecation_logger#deprecated() so that it goes to the deprecation log.

it "should instantiate cleanly" do
params = { "dummy_option" => "potatoes", "codec" => "json", "workers" => 2 }
worker_params = params.dup; worker_params["workers"] = 1
params = { "dummy_option" => "potatoes", "codec" => "json" }
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.

here's a bug that pre-existed your change: the params local variable is assigned but not used.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch!

Comment thread logstash-core/lib/logstash/config/mixin.rb Outdated
@andrewvc
Copy link
Copy Markdown
Contributor Author

@yaauie thanks for the review, I've incorporated all your fixes, should be ready for review again.

@kaisecheng
Copy link
Copy Markdown
Contributor

/run exhaustive tests

@kaisecheng
Copy link
Copy Markdown
Contributor

run exhaustive tests

Copy link
Copy Markdown
Contributor

@kaisecheng kaisecheng left a comment

Choose a reason for hiding this comment

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

LGTM. The red CI is unrelated to this change

Copy link
Copy Markdown
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

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

I think that the general approach makes sense. I have a couple comments on finding a path forward that gives users more-meaningful info if/when they hit the issue.

Comment thread logstash-core/lib/logstash/outputs/base.rb Outdated
Comment thread logstash-core/lib/logstash/config/mixin.rb Outdated
andrewvc and others added 2 commits April 30, 2026 14:06
Add rye's suggestion for improved error message for legacy concurrency plugins

Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
Use inspect  in the corner case of missing `config_name`

Co-authored-by: Rye Biesemeyer <yaauie@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-skip Skip automated backport with mergify bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove :legacy output strategy and change default Ruby output concurrency to :single

5 participants