Skip to content

server: expose uvicorn timeout_keep_alive in config#667

Merged
Pangjiping merged 1 commit intoalibaba:mainfrom
ninan-nn:feature/refine_uvicorn_settings
Apr 8, 2026
Merged

server: expose uvicorn timeout_keep_alive in config#667
Pangjiping merged 1 commit intoalibaba:mainfrom
ninan-nn:feature/refine_uvicorn_settings

Conversation

@ninan-nn
Copy link
Copy Markdown
Collaborator

@ninan-nn ninan-nn commented Apr 8, 2026

Summary

  • add server.timeout_keep_alive to the server config and default it to 30
  • pass app_config.server.timeout_keep_alive into both uvicorn.run(...) entrypoints
  • make uvicorn keep-alive behavior configurable through OpenSandbox config instead of relying on uvicorn's implicit default (5s)

Motivation:
JavaScript/Python/Kotlin SDKs all keep idle pooled HTTP connections around for about 30 seconds. The lifecycle server was still using uvicorn's default timeout_keep_alive=5, which makes stale keep-alive reuse more likely and can surface as transient ECONNRESET on follow-up requests.

Testing

  • Not run
  • Unit tests
  • Integration tests
  • e2e / manual verification

Not run because this change only wires an existing uvicorn runtime option through server config. Validation should be done by restarting the server and verifying requests after short idle gaps no longer hit the previous default behavior.

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

Backward compatibility:

  • existing configs continue to work without changes
  • if server.timeout_keep_alive is omitted, the server now defaults to 30 instead of inheriting uvicorn's implicit 5

@ninan-nn ninan-nn changed the title feat(server): refine uvicorn timeout keep alive server: expose uvicorn timeout_keep_alive in config Apr 8, 2026
Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangjiping Pangjiping added bug Something isn't working component/server labels Apr 8, 2026
@Pangjiping Pangjiping merged commit 9bd27a6 into alibaba:main Apr 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working component/server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants