fix(runners): wire job_retry.lambda_memory_size and lambda_timeout#5120
Merged
Brend-Smits merged 2 commits intoJun 11, 2026
Merged
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.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes configuration wiring in the modules/runners Terraform module so that user-provided job_retry.lambda_memory_size and job_retry.lambda_timeout are actually passed into the internal job-retry/Lambda submodule rather than being silently dropped.
Changes:
- Thread
var.job_retry.lambda_memory_sizethrough asmemory_sizeinlocal.job_retry. - Thread
var.job_retry.lambda_timeoutthrough astimeoutinlocal.job_retry.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Brend-Smits
approved these changes
Jun 11, 2026
Brend-Smits
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thanks for the fix!
Brend-Smits
pushed a commit
that referenced
this pull request
Jun 11, 2026
🤖 I have created a release *beep* *boop* --- ## [7.7.0](v7.6.1...v7.7.0) (2026-06-11) ### Features * Add feature to enable dynamic ec2 config via workflow labels ([#5003](#5003)) ([c68445d](c68445d)) * add support for macos runners ([#4930](#4930)) ([3e179a3](3e179a3)) * Introduce Amazon Linux 2023 ARM image ([#4780](#4780)) ([e572ae5](e572ae5)) * relax cpu_options schema and add amd_sev_snp + nested_virtualization support ([#5039](#5039)) ([5a3746d](5a3746d)) * **runner-role:** Enable using separate IAM role for runners ([#4875](#4875)) ([6642e57](6642e57)) ### Bug Fixes * **ci:** sign auto-generated docs commits ([#5154](#5154)) ([a6af4d2](a6af4d2)) * **runners:** wire job_retry.lambda_memory_size and lambda_timeout ([#5120](#5120)) ([404785e](404785e)) * **scale-up:** Add ec2:TerminateInstances permission to scale-up Lambda IAM policy ([#5152](#5152)) ([94c4e12](94c4e12)) * **scale-up:** prevent negative TotalTargetCapacity when runners exceed maximum ([#5062](#5062)) ([9ab7410](9ab7410)) * **webhook:** Fix publish events to EventBridge ([#5143](#5143)) ([a72b737](a72b737)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: runners-releaser[bot] <194412594+runners-releaser[bot]@users.noreply.github.com>
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.