Repository navigation
Zeta 后端:executorMemory 小数串(如 1.5g)透传 Livy 导致作业必 dead - #255
Merged
todosdev[bot] merged 2 commits intoNov 29, 2026
Merged
Conversation
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.
概要
executorMemory/driverMemory为小数串(如1.5g)被原样透传,Spark 3.5.3spark-submit拒绝小数串("Executor memory must be a positive number")导致作业必 dead 的问题。normalizeMemory,把通过校验的内存串规范化为整数单位(1.5g→1536m、1g→1024m)后再透传,同时保持既有 1.5g 上限与校验/字段名语义不变。变更
worker/src/routes/livy.tsnormalizeMemory:整 MB 值 → 整数 MB;<1MB值 → 整数 KB、再退到整数字节;非整字节小数四舍五入为整字节,保证输出为 Spark 接受的正整数单位串。driverMemory/executorMemory在通过parseMemoryToBytes校验、并完成executorMemory的MAX_EXECUTOR_MEMORY_BYTES(1.5g)上限检查后,改用normalizeMemory的结果透传,不再透传原始字符串。worker/src/routes/__tests__/livy.test.ts1g→1024m、上限1.5g→1536m。normalizeMemory单测组,覆盖1.5g/1.5gb/0.5g→整数 MB,1g/1536m/512m/1t规范化,以及512k/1kb/1024b/1b的 KB/字节回退。测试
cd worker && pnpm exec vitest run src/routes/__tests__/livy.test.ts:49 通过。cd worker && pnpm exec tsc --noEmit:通过。pnpm exec biome check worker/src/routes/livy.ts worker/src/routes/__tests__/livy.test.ts:通过。workflow_dispatch(run46257383707)Validate job 全绿:lint / format check / build web / typecheck worker / test worker / test web 均通过。spark-live.test.ts、spark-cancel-live.test.ts为 live 集成测试,需真实 Spark 服务,本地环境不可达会失败,与本次改动无关(CI runner 上已全绿)。