-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
deprecate pipeline bus v1 #16643
base: 8.x
Are you sure you want to change the base?
deprecate pipeline bus v1 #16643
Conversation
Quality Gate passedIssues Measures |
The addition of the logger commit makes sense. Im a bit confused about the retrofit test commit though c51a7d5 is that refactor a general update that is extending a pattern being applied elsewhere you could point me to? After looking closer: I see organizational improvements and some more formal coverage of the |
|
||
// This should unblock the listener thread | ||
bus.unregisterSender(output, addresses); | ||
TimeUnit.SECONDS.toMillis(30); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was just moved around, not introduced but I think its unused.
Yeah, the first commit just retrofits tests onto the bit that selects which implementation to use, and needed to wrap the existing As you saw, the star of the PR is the second commit, which adds the deprecation log and verifies that it is emitted in the right conditions. In retrospect, the other two tests should have a negative assertion. I'll add those and bounce it back. |
bf76848
to
93e9155
Compare
Quality Gate passedIssues Measures |
💚 Build Succeeded
History
|
case "v1": return new PipelineBusV1(); | ||
case "v1": | ||
DEPRECATION_LOGGER.deprecated("The legacy pipeline bus selected with `logstash.pipelinebus.implementation=v1` is deprecated, and will be removed in a future release of Logstash"); | ||
return new PipelineBusV1(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like in the case we have an "unknown" configuration setting we "default" to v1 still. Maybe as part of calling out v1 is deprecated we can also change that fallback to also be v2.
diff --git a/logstash-core/src/main/java/org/logstash/plugins/pipeline/PipelineBus.java b/logstash-core/src/main/java/org/logstash/plugins/pipeline/PipelineBus.java
index 487793d62..b10fa6729 100644
--- a/logstash-core/src/main/java/org/logstash/plugins/pipeline/PipelineBus.java
+++ b/logstash-core/src/main/java/org/logstash/plugins/pipeline/PipelineBus.java
@@ -54,7 +54,7 @@ public interface PipelineBus {
case "v2": return new PipelineBusV2();
default:
LOGGER.warn("unknown pipeline-bus implementation: {}", pipelineBusImplementation);
- return new PipelineBusV1();
+ return new PipelineBusV2();
}
}
@@ -45,7 +48,9 @@ public interface PipelineBus { | |||
static PipelineBus create() { | |||
final String pipelineBusImplementation = System.getProperty("logstash.pipelinebus.implementation", "v2"); | |||
switch (pipelineBusImplementation) { | |||
case "v1": return new PipelineBusV1(); | |||
case "v1": | |||
DEPRECATION_LOGGER.deprecated("The legacy pipeline bus selected with `logstash.pipelinebus.implementation=v1` is deprecated, and will be removed in a future release of Logstash"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like configuring pipeline bus implementation setting itself is or should be deprecated. Maybe the deprecation should be focused on removing that setting rather than the value it is set to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default case for when an unknown setting is encountered should default to v2 https://github.com/elastic/logstash/pull/16643/files#r1889364653
If I understand the introduction of the configuration option for the pipeline bus implementation #16194 it was as a safety latch for any case where using the v2 implementation caused an issue. With the default being v2 and the stability we have observed I would imagine in LS v 9 we would be able to deprecate this configuration option all together (along with replacing v1 with v2). https://github.com/elastic/logstash/pull/16643/files#r1889381525
Release notes
What does this PR do?
Adds a deprecation warning if Logstash is configured to use the legacy v1 pipeline bus. The legacy implementation was replaced with a more-performant one in 8.15.0, and v1 was only left in place as an "escape hatch".
The ability to select v1 implementation is set to be removed onmain
in advance of 9.0 via #16644Why is it important/What is the impact to the user?
It guides users away from the original lock-heavy implementation, which was previously only available as an escape hatch and is no longer necessary.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)How to test this PR locally
-Dlogstash.pipelinebus.implementation=v1
toconfig/jvm.options