Skip to content

fix(webhook): a failed config load is cached, so the dispatcher drops every job until the container is recycled #5518

Closed

Description

@atsikham

Summary

BaseConfig.load() in lambdas/functions/webhook/src/ConfigLoader.ts caches a failed config load for the life of the Lambda container. After one failed load, the container keeps an empty matcherConfig and silently drops every job, even after the configuration is fixed.

Root cause

if (!this.instance) {
  this.instance = new (this as unknown as { new (): T })();   // cached before loading
  await this.instance.loadConfig();                            // a failure leaves matcherConfig = []
  if (this.instance.configLoadingErrors.length > 0) {
    throw new Error(`Failed to load config: ...`);             // thrown once; the instance stays cached
  }
}
return this.instance as T;                                     // later calls reuse the broken instance

this.instance is assigned before loadConfig() and is not cleared when loading fails.

Effect

  • The first event in a container fails with Failed to load config: ....
  • Every later event in that container gets the cached instance with an empty matcherConfig. The dispatcher answers with notAccepted() (WARN, HTTP 202) for every job.
  • The container never retries, so it keeps dropping jobs after the configuration is fixed, until Lambda recycles the container.
  • The Lambda Errors metric counts one error per container, not one per dropped event, so the scale of the problem is hidden.
  • The failure is logged at debug level, so it is not visible without debug logging.
  • Dropped events are not redelivered, because GitHub already received its response from the webhook Lambda.

All config classes built on BaseConfig are affected (ConfigWebhook, ConfigWebhookEventBridge, ConfigDispatcher), so both direct and EventBridge mode are affected.

A temporary config load failure is enough to trigger it, for example a matcher config SSM parameter that is missing while an apply is in progress.

Proposed fix

Assign this.instance only after a successful load, and log a failed load at error level. Every event that hits a broken config then fails loudly, and a container recovers by itself as soon as the configuration is fixed.

Activity

  1. added a commit that references this issue on Oct 21, 2026
    a2fea96
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