Add SMOLQUERY_JOB_MEMORY_LIMIT to size query job engines (T-631) - #455
Merged
chasers merged 2 commits intoOct 4, 2026
Merged
Conversation
chasers
added this pull request to stack #456
October 4, 2026 01:45
added 2 commits
October 4, 2026 02:01
job_memory_limit, each query job engine's DuckDB memory_limit, was set only in compiled config at 1GB. Every other engine limit already has an environment variable (SMOLQUERY_MEMORY_LIMIT, SMOLQUERY_STORAGE_MEMORY_LIMIT, SMOLQUERY_DISTRIBUTED_WORKER_MEMORY_LIMIT, SMOLQUERY_WRITE_ENGINE_MEMORY_LIMIT), so a deploy could not size the query side without a rebuild. SMOLQUERY_JOB_MEMORY_LIMIT now sets it in config/runtime.exs. Unset, nothing changes. A scatter worker engine still inherits it whole unless SMOLQUERY_DISTRIBUTED_WORKER_MEMORY_LIMIT is set. Like its siblings, the size string passes through as given; docs say a value DuckDB refuses fails every job engine as it starts. docs/configuration.md gets the row and points the worker limit's default at it; docs/deployment.md gets a 0.22.0 upgrade note.
Code review of PR 455 (/code-review high). SMOLQUERY_JOB_MEMORY_LIMIT passed through unchecked, so an empty value from an unfilled template, or a word, booted a healthy-looking node whose every job engine then failed to start, warm-pool rebuilds included. RuntimeConfig.size!/2 now checks the shape at boot: a number and an optional unit. DuckDB still owns the unit grammar, so the check refuses only what can never be a size. The other memory limit variables keep passing through as before.
chasers
force-pushed
the
t-631-job-memory-limit-env
branch
from
October 4, 2026 02:06
f22e263 to
7dafe9b
Compare
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.
TL;DR: Add
SMOLQUERY_JOB_MEMORY_LIMIT. It sets each query job engine's DuckDB memory limit from the environment.Tracker: T-631. Stacked on PR 454 (T-630).
Why
job_memory_limitwas set only in compiled config, at1GB.What changed
config/runtime.exs:SMOLQUERY_JOB_MEMORY_LIMITsetsSmolquery.QueryServicejob_memory_limit.1GB.SMOLQUERY_DISTRIBUTED_WORKER_MEMORY_LIMITis set.docs/configuration.md, and a 0.22.0 note indocs/deployment.md.Budget
SMOLQUERY_JOB_MEMORY_LIMITmax_concurrent_jobsSMOLQUERY_DISTRIBUTED_WORKER_MEMORY_LIMIT, elseSMOLQUERY_JOB_MEMORY_LIMITTests
runtime_config_test: the variable reachesjob_memory_limit, and an empty value fails the boot.RuntimeConfig.size!/2: accepts4GB,512 MiB,1.5GB; refuses empty, words, negatives.Checks
mix precommit,mix ci,mix dialyzerpass locally.Review
/code-review highfound one issue. Fixed in "Review of T-631":RuntimeConfig.size!/2).Watch out
🤖 Generated with Claude Code