Open carsonip opened 2 weeks ago
@carsonip can you please assess the impact of this in your description and then add an according impact
label for this. While I agree the reload is unnecessary, how much of an optimization is it vs. what's the negative consequence.
IIUC the bug sits in beats. It is better seen as a regression from supporting apm tracing config reload in https://github.com/elastic/beats/pull/40030 . As for the impact, I don't think it will create any actual problems, other than some extra API calls e.g. for agentcfg and sourcemap fetcher as part of the initialization process. If any new connection is unlucky enough to use the new runner that gets stopped immediately, these connections will need to be drained. Also, although I haven't studied how likely it is relevant, but it is possible that a reload that quick will trigger some race conditions (a bug in itself), e.g. if runners from 2 consecutive quick restarts race to modify a global monitoring registry.
TLDR: not high impact, but as this is a recent regression, it would be good to optimize this.
This issue doesn't have a Team:<team>
label.
APM Server version (
apm-server version
): 8.15.0+Description of the problem including expected versus actual behavior:
APM server reloader reloads runner (internal/beater/beater.go) 2 times instead of 1 when integration policy is changed.
This is likely due to nil check being earlier than the unchanged check in EA apm tracing PR: https://github.com/elastic/beats/pull/40030/files#diff-dd024b66f2ed585cbbfce1d8a0aeba55183ab0d04bed2a67f7738f62b5658e63R896-R908 . This causes apm tracing config nil -> nil to trigger a reload.
When this is fixed, we should also remove the workaround in https://github.com/elastic/apm-server/pull/14574/files#diff-e91b3485079439409a6365ec6aa74c2c009623463528bc9d541ca6494df8cf35R350
Steps to reproduce:
loaded input config
log line is accompanied by aloaded apm tracing config
even though apm tracing config has not changed. This implies 2 reloads are done instead of 1.Provide logs (if relevant):
apm-server log lines from new to old. Everything is triggered by
BeatV2Manager.unitListen
, followed byloaded apm tracing config
, thenloaded input config
.