You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(webhook): a failed config load is cached, so the dispatcher drops every job until the container is recycled #5518
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(thisasunknownas{new(): T})();// cached before loadingawaitthis.instance.loadConfig();// a failure leaves matcherConfig = []if(this.instance.configLoadingErrors.length>0){thrownewError(`Failed to load config: ...`);// thrown once; the instance stays cached}}returnthis.instanceasT;// 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
fix(webhook): cache only a successful config load (github-aws-runners…