Open andsel opened 11 hours ago
This problem raises from the fact the Agent cyclically (if autoreload is enabled) reload and resolve pipeline configuration, in checking if Settings instances has changed, it invokes the equals
method which goes deep to the DeprecatedAlias.value
and so the log.
In more details: https://github.com/elastic/logstash/blob/e84fb458ce2f092e065c63df649222f8cbda8c44/logstash-core/lib/logstash/agent.rb#L132
In checking equality of hash map both keys and values of hash maps are accessed. The map (due to the with_deprecated_alias
) contains 2 settings one for api.enabled
which is the SettingWithDeprecatedAlias
proxy and another for http.enabled
which is the instance of DeprecatedAlias
. So it seems that every time this comparison process accesses an instance of DeprecatedAlias
then the value()
method is also invoked.
The motivation of access the value
is that Settings#to_hash
method does it:
Description of the problem including expected versus actual behavior: After merge of PR #15679 which introduced new Java classes for base, aliased and Boolean setting translating from Ruby existing code, if Logstash runs with the reload of a pipeline flag (both as command line
--config.reload.automatic
or configuring it inconfig/logstash.yml
, it starts repeating the following error log:This happens only when the pipeline is configured in
config/pipelines.yml
, both asconfig.string
or with pathpath.config
. Instead, it doesn't happen when running directly the pipeline form the file withlogstash -f simple_pipeline.conf
Steps to reproduce:
Please include a minimal but complete recreation of the problem, including (e.g.) pipeline definition(s), settings, locale, etc. The easier you make for us to reproduce it, the more likely that somebody will take the time to look at it.
config/pipelines.yml
addingIf the reload it's not enabled, it doesn't happen. Also note that it happend every 3 seconds (the default value of
config.reload.interval
) and appears always twiceProvide logs (if relevant):