Skip to content

fix(server): configure egress sidecar readiness timeout - #1522

Open
luppyw wants to merge 2 commits into
opensandbox-group:mainfrom
luppyw:fix/1489-egress-timeout
Open

fix(server): configure egress sidecar readiness timeout#1522
luppyw wants to merge 2 commits into
opensandbox-group:mainfrom
luppyw:fix/1489-egress-timeout

Conversation

@luppyw

@luppyw luppyw commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add [egress].timeout_seconds so Docker deployments can configure how long the server waits for the egress sidecar health endpoint to become ready.
  • Preserve the existing 30-second default, reject non-positive values, wire the setting into the Docker readiness check, and update configuration examples and documentation.
  • Fixes Feature request: Egress sidecar timeout config #1489.

Testing

  • Not run (explain why)
  • Unit tests
    • pytest tests/test_config.py (90 passed)
    • pytest tests/test_docker_service.py (133 passed)
    • ruff check opensandbox_server/config.py opensandbox_server/services/docker/networking.py tests/test_config.py tests/test_docker_service.py
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

@github-actions github-actions Bot added component/server size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 14, 2026
@luppyw

luppyw commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

@Pangjiping Could you please review this PR when you have time? If the changes look correct and the required checks pass, would you be willing to merge it? I will address any requested changes promptly.

简体中文

@Pangjiping 方便时能否帮忙审核一下这个 PR?如果修改没有问题且必要检查通过,麻烦帮忙合并;如果需要调整,我会及时跟进。

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fea4b024e3

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +754 to +756
timeout_seconds: float = Field(
default=30.0,
gt=0,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Enforce the configured timeout during each health probe

When timeout_seconds is set below one second, which this field explicitly permits, a slow health endpoint can still block for the hard-coded one-second urlopen timeout and then sleep another 0.2 seconds. Consequently, the operation can substantially exceed the documented maximum; cap each probe and sleep to the remaining deadline, or reject values below the polling granularity.

AGENTS.md reference: server/AGENTS.md:L42-L42

Useful? React with 👍 / 👎.

"(e.g. IPv4-only CNI or experimenting with IPv6 egress despite gaps)."
),
)
timeout_seconds: float = Field(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (non-blocking): timeout_seconds is a bit generic — the [egress] section may later grow other timeouts (e.g., per-request API timeouts), and this one specifically bounds the readiness wait. Since the PR is not merged yet, renaming is nearly free. Something like ready_timeout_seconds (matches _wait_for_egress_sidecar_ready) or readiness_timeout_seconds (K8s readinessProbe terminology) would make the intent explicit. If renamed, remember to update networking.py, server/configuration.md, both example TOMLs, docker-compose.example.yaml, and the test assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/server size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Egress sidecar timeout config

2 participants