Closed
Description
openedon Nov 15, 2022
elastic/apm-nodejs-http-client#185 was recently implemented for #2941
Ironically it made things worse.
Typically APM server's endpoint for central config will return a cache-control header, e.g.:
Cache-Control: max-age=<number of seconds>
If so, everything with v3.40.0 of the APM agent is fine.
However, if a central config request gets a response that doesn't specify a Cache-Control header, or one without a 'max-age' field, then getMaxAge(res)
returns NaN
and getCentralConfigIntervalS(NaN)
unintentionally returns NaN
:
> const INTERVAL_MIN_S = 5
undefined
> const INTERVAL_MAX_S = 86400 // 1d
undefined
> seconds = NaN
NaN
> Math.min(Math.max(seconds, INTERVAL_MIN_S), INTERVAL_MAX_S)
NaN
which leads to a tight loop of the agent hammering APM server for central config.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment