fix(runners): wire job_retry.lambda_memory_size and lambda_timeout#5120
Open
oscarbc96 wants to merge 1 commit intogithub-aws-runners:mainfrom
Open
fix(runners): wire job_retry.lambda_memory_size and lambda_timeout#5120oscarbc96 wants to merge 1 commit intogithub-aws-runners:mainfrom
oscarbc96 wants to merge 1 commit intogithub-aws-runners:mainfrom
Conversation
The job_retry variable on both the multi-runner and runners modules declares lambda_memory_size and lambda_timeout, but the local.job_retry map in modules/runners/job-retry.tf never copied either field into the config passed to the inner job-retry / lambda sub-modules. The inner lambda module fell back to its defaults (memory_size = 256, timeout = 60), so user-supplied values were silently dropped. Mirrors the pattern already used by ssm-housekeeper.tf (local.ssm_housekeeper.lambda_memory_size / local.ssm_housekeeper.lambda_timeout) — the ssm-housekeeper Lambda correctly threads the values through; the job-retry one didn't. Observed in production: a deployment pinned to lambda_memory_size = 512 in multi_runner_config[*].runner_config.job_retry produced no plan diff because the value never reached the resource. The job-retry Lambdas were OOM-adjacent at 87% memory utilisation (223 MB peak on the 256 MB default) on a fleet of three runners.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Both
var.job_retry(inmodules/multi-runner/variables.tfandmodules/runners/variables.tf) declarelambda_memory_sizeandlambda_timeoutas documented configuration fields, butlocal.job_retryinmodules/runners/job-retry.tfnever copies either field into theconfigmap passed to the innerjob-retry/lambdasub-modules. The inner lambda module then falls back to its defaults (memory_size = 256,timeout = 60), so user-supplied values are silently dropped —tofu planshows no diff and the running Lambda keeps its defaults.The fix is a two-line addition to the
local.job_retrymap. It mirrors the patternmodules/runners/ssm-housekeeper.tfalready uses forlocal.ssm_housekeeper.lambda_memory_size/local.ssm_housekeeper.lambda_timeout— that Lambda correctly threads the values through.Motivation
Discovered in production: I pinned
lambda_memory_size = 512inmulti_runner_config[*].runner_config.job_retryafter observing the job-retry Lambdas at 87% memory utilisation (223 MB peak on the 256 MB default), and gotNo changesfromtofu plan. Tracing the wiring confirmed the value never reaches the resource.Reproduction
After this fix,
tofu planshows the expectedmemory_size: 256 -> 512change on the job-retry Lambda.Verification
tofu fmtclean.modules/runners/variables.tfandmodules/multi-runner/variables.tfalready declareslambda_memory_size = optional(number, 256)andlambda_timeout = optional(number, 30), so no public surface changes.modules/runners/modules/lambdaacceptsmemory_sizeandtimeouton itslambdainput object (with the same defaults), so when the wiring is restored the values flow through naturally.No-impact when not set
Defaults remain
memory_size = 256(per the variable declaration) andtimeout = 30— same as today's effective values when nothing is overridden.