Skip to content

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

@kaisecheng

Description

@kaisecheng

Background

Logstash output plugins declare their concurrency model via concurrency :shared, concurrency :single, or the default :legacy. The :legacy strategy was originally designed to support a per-output workers setting that created N independent plugin instances distributed via a BlockingQueue. Currently, the workers can only be 1. This model predates the current pipeline.workers architecture.

Current State

An audit of all Elastic maintained output plugins across the logstash-plugins organisation:

  • :single: google_cloud_storage, icinga, stdout, tcp, zeromq
  • :shared (via concurrency :shared or the deprecated declare_threadsafe!): elasticsearch, file, google_bigquery, google_pubsub, http, kafka, rabbitmq, s3, sns, sqs, timber, integration-aws, integration-kafka, integration-logstash, integration-rabbitmq
  • :legacy (default, no explicit declaration): appsearch, boundary, circonus, cloudwatch, csv, datadog, datadog_metrics, elastic_app_search, email, exec, firehose, ganglia, gelf, graphite, hipchat, influxdb, irc, jira, jms, logentries, loggly, lumberjack, mongodb, nagios, nagios_nsca, newrelic, null, opentsdb, pagerduty, pipe, redis, riemann, slack, statsd, stomp, syslog, udp, webhdfs, websocket, xmpp, zabbix, zookeeper, integration-elastic_enterprise_search, integration-zeromq

None of these plugins configure a workers value. LegacyOutputStrategyExt therefore always initialises with workers = 1, creating a single instance behind a BlockingQueue of size 1. This is functionally identical to SingleOutputStrategy.

declare_workers_not_supported! is unused across the entire logstash-plugins organisation.

Problem

The :legacy strategy is still supported but no plugin actively uses its multi-worker capability. Keeping it as the default misleads plugin authors into thinking per-output worker pools are still actively maintained and in use.

Proposal

  1. Change the default in outputs/base.rb from :legacy to :single
  2. Remove LegacyOutputStrategyExt and its registration in RubyUtil.java
  3. Remove the deprecated declare_workers_not_supported! helper
  4. Add a deprecation warning if any plugin explicitly declares concurrency :legacy

Risk

No behavioural change for any current plugin. All plugins currently on :legacy with workers = 1 will have identical serialised-access semantics under :single. The only breaking case would be a custom plugin that explicitly declares concurrency :legacy and sets workers > 1 in user config, which is not supported by any known plugin.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions