Skip to content

Local evaluation: a failed background flag config poll is logged at debug only #84

Open

Description

@adaaaamwen

Expected Behavior

When the local evaluation client's background poll for flag configs fails, the failure is logged at a level that reaches the application's logs under the default logLevel (LogLevel.Error), the same way CohortPoller already reports a failed cohort poll:

https://github.com/amplitude/experiment-node-server/blob/main/packages/node/src/local/cohort/poller.ts#L98

Current Behavior

FlagConfigPoller.start() catches the periodic update() failure and logs it at debug:

https://github.com/amplitude/experiment-node-server/blob/main/packages/node/src/local/poller.ts#L60-L62

} catch (e) {
  this.logger.debug('[Experiment] flag config update failed', e);
}

With the default LogLevel.Error the line never appears, so a client that stopped receiving flag updates keeps serving its last configs silently. Only the initial poll in start() is logged at error. The only way to see the periodic failure today is logLevel: LogLevel.Debug, which also emits a line per poll and per evaluateV2 call.

This matters because for local evaluation the poll is the only path a dashboard change (including turning a flag off) reaches the process.

Possible Solution

Log the periodic poll failure at error, matching [Experiment] cohort poll failed in the same package. One-line change in packages/node/src/local/poller.ts; PR to follow.

Steps to Reproduce

  1. Experiment.initializeLocal(key) with default config, await client.start().
  2. Make https://flag.lab.amplitude.com unreachable (e.g. block it or drop the network).
  3. Wait past flagConfigPollingIntervalMillis (30s).
  4. Nothing is logged; evaluateV2 keeps returning results from the last successful poll.

Environment

  • JS Server SDK Version: 1.13.6 (same on main)
  • Installation Method: npm / pnpm
  • Runtime: Node 24

Activity

  1. added a commit that references this issue on Oct 12, 2026
    9e564b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions