Skip to content

[9.0] Removed config hash computation from pipeline (backport #17336) #17419

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

Open
wants to merge 1 commit into
base: 9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion logstash-core/spec/logstash/pipeline_action/reload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

it "run the new pipeline code" do
subject.execute(agent, pipelines)
expect(pipelines.get_pipeline(pipeline_id).config_hash).to eq(new_pipeline_config.config_hash)
expect(pipelines.get_pipeline(pipeline_id).pipeline_config.config_hash).to eq(new_pipeline_config.config_hash)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalUnit;
Expand All @@ -48,7 +47,6 @@
import java.util.stream.Stream;

import com.google.common.annotations.VisibleForTesting;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.jruby.Ruby;
Expand Down Expand Up @@ -146,8 +144,6 @@ public class AbstractPipelineExt extends RubyBasicObject {
@SuppressWarnings({"rawtypes", "serial"})
private List<SourceWithMetadata> configParts;

private RubyString configHash;

private transient IRubyObject settings;

private transient IRubyObject pipelineSettings;
Expand Down Expand Up @@ -263,11 +259,6 @@ private AbstractPipelineExt initialize(final ThreadContext context,
pipelineSettings = pipelineConfig;
configString = (RubyString) pipelineSettings.callMethod(context, "config_string");
configParts = pipelineSettings.toJava(PipelineConfig.class).getConfigParts();
configHash = context.runtime.newString(
Hex.encodeHexString(
MessageDigest.getInstance("SHA1").digest(configString.getBytes())
)
);
settings = pipelineSettings.callMethod(context, "settings");
final IRubyObject id = getSetting(context, SettingKeyDefinitions.PIPELINE_ID);
if (id.isNil()) {
Expand Down Expand Up @@ -356,11 +347,6 @@ public final RubyString configStr() {
return configString;
}

@JRubyMethod(name = "config_hash")
public final RubyString configHash() {
return configHash;
}

@JRubyMethod(name = "ephemeral_id")
public final RubyString ephemeralId() {
return ephemeralId;
Expand Down