Skip to content

[core] feat: support multiple veFaaS functions and fix KillSandbox hang#94

Merged
yyDing1 merged 1 commit into
verl-project:mainfrom
xuefei199288:feat/vefaas-multi-function-and-killsandbox-fix
Jul 26, 2026
Merged

[core] feat: support multiple veFaaS functions and fix KillSandbox hang#94
yyDing1 merged 1 commit into
verl-project:mainfrom
xuefei199288:feat/vefaas-multi-function-and-killsandbox-fix

Conversation

@xuefei199288

Copy link
Copy Markdown
Contributor

Summary

  • Allow VEFAAS_FUNCTION_ID / VEFAAS_FUNCTION_ROUTE to each hold a comma-separated list of paired values. Each sandbox binds to one randomly chosen (function_id, function_route) pair for its lifetime, spreading load across functions with no shared/coordinated state.
  • Add is_vefaas_rate_limited / is_vefaas_not_found (429 / 404) error classifiers, and let _get_vefaas_client accept explicit credentials so external drivers can build their own client pool.
  • Fix KillSandbox hanging in Terminating: switch the sandbox start command from curl ... | bash to a download-then-exec bash form. With a pipe, the install script's shell is never PID 1, so its SIGTERM trap can't fire on KillSandbox and the sandbox hangs until the grace window expires. exec makes the script shell PID 1 so it receives SIGTERM directly and cleans up.

Test plan

  • Unit tests: single/multi function pairing, random selection covering every function, mismatched id/route counts raise, missing env raises (tests/uni_agent/sandbox/test_exec_error_policy.py).
  • Docs updated for the comma-separated multi-function env vars (docs/source/quickstart/launch-sandbox.md).
  • Live veFaaS run: confirm KillSandbox no longer hangs in Terminating with the exec bash start command.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@xuefei199288
xuefei199288 force-pushed the feat/vefaas-multi-function-and-killsandbox-fix branch 2 times, most recently from 82eae3e to 78eeb48 Compare July 25, 2026 09:59
Allow VEFAAS_FUNCTION_ID / VEFAAS_FUNCTION_ROUTE to each hold a
comma-separated list of paired values; each sandbox binds to one randomly
chosen (function_id, function_route) pair for its lifetime, spreading load
across functions with no shared state. _get_vefaas_client also accepts
explicit credentials so callers can build their own client pool.

Also switch the sandbox start command from `curl ... | bash` to a
download-then-`exec bash` form: with a pipe the install script's shell is
never PID 1, so its SIGTERM trap can't fire on KillSandbox and the sandbox
hangs in Terminating until the grace window expires. `exec` makes the script
shell PID 1 so it receives SIGTERM directly and cleans up.

Includes docs and unit tests for pairing, random selection, and env validation.
@xuefei199288
xuefei199288 force-pushed the feat/vefaas-multi-function-and-killsandbox-fix branch from 78eeb48 to dc394a0 Compare July 25, 2026 09:59
@yyDing1

yyDing1 commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@yyDing1
yyDing1 merged commit 5b1277b into verl-project:main Jul 26, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants