Skip to content

feat(sdks): client sandbox pool implementation - #393

Merged
jwx0925 merged 1 commit into
opensandbox-group:mainfrom
ninan-nn:feature/client_pool_impl
Mar 24, 2026
Merged

feat(sdks): client sandbox pool implementation#393
jwx0925 merged 1 commit into
opensandbox-group:mainfrom
ninan-nn:feature/client_pool_impl

Conversation

@ninan-nn

@ninan-nnninan-nn commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Implement Kotlin SDK SandboxPool with client-side idle buffer management and configurable acquire policy (FAIL_FAST / DIRECT_CREATE).
  • Add pool domain model and extensibility points: PoolConfig, PoolCreationSpec, PoolSnapshot, PoolState, PoolStateStore, and InMemoryPoolStateStore.
  • Add reconcile loop with leader-gated replenish behavior for distributed deployments, including:
    • primary lock acquire/renew flow
    • stale idle fallback handling
    • degraded state/backoff tracking
    • lock-loss guard during putIdle
    • best-effort orphan cleanup callback on lock-loss window
  • Improve lifecycle/concurrency safety in SandboxPool:
    • periodic reconcile tick exception guard (prevents scheduler from silently stopping)
    • resize vs shutdown race handling (RejectedExecutionException safe path)
    • graceful shutdown waits for local in-flight operations (bounded by drainTimeout)
  • Remove @Deprecated annotation from SandboxPool to align with README guidance while keeping feature marked experimental in docs.
  • Update Kotlin SDK README (EN/ZH) with pool usage and distributed-store expectations.
  • Add/extend tests:
    • Kotlin unit tests for reconciler/store/pool behavior (including distributed-lock edge cases)
    • Java pool E2E coverage:
      • existing single-node pool suite
      • new pseudo-distributed suite with shared in-process distributed-like store

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Executed:

  • cd sdks/sandbox/kotlin && ./gradlew spotlessApply build
  • cd tests/java && ./gradlew test --tests "*SandboxPool*E2ETest"

Result summary:

  • SandboxPoolSingleNodeE2ETest: 15/15 passed
  • SandboxPoolPseudoDistributedE2ETest: 7/7 passed

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

@ninan-nn
ninan-nnforce-pushed the feature/client_pool_impl branch 11 times, most recently from 543d870 to 991e526CompareMarch 13, 2026 03:50
@ninan-nnninan-nn changed the title client pool implfeat(sdks): client sandbox pool implementationMar 13, 2026
@ninan-nn
ninan-nnforce-pushed the feature/client_pool_impl branch from 991e526 to 9ecdc1fCompareMarch 13, 2026 04:06
@ninan-nn
ninan-nn marked this pull request as ready for review March 13, 2026 04:13

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:9ecdc1f260

ℹ️ 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".

@ninan-nn
ninan-nnforce-pushed the feature/client_pool_impl branch from 9ecdc1f to 75ca5a8CompareMarch 16, 2026 02:51
@hittyt

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:75ca5a84db

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ninan-nn
ninan-nnforce-pushed the feature/client_pool_impl branch 2 times, most recently from 3495072 to c7519f5CompareMarch 17, 2026 07:21
hittyt
hittyt previously approved these changes Mar 17, 2026

@hittythittyt left a comment

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.

LGTM

@PangjipingPangjiping added feature New feature or request sdk/java labels Mar 17, 2026
Pangjiping
Pangjiping previously approved these changes Mar 17, 2026

@PangjipingPangjiping left a comment

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.

LGTM

@ninan-nn
ninan-nn dismissed stale reviews from Pangjiping and hittyt via 9c776edMarch 18, 2026 02:03
@ninan-nn
ninan-nnforce-pushed the feature/client_pool_impl branch from c7519f5 to 9c776edCompareMarch 18, 2026 02:03

@PangjipingPangjiping left a comment

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.

LGTM

@jwx0925

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connectorchatgpt-codex-connectorBot 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:9c776ed674

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@PangjipingPangjiping left a comment

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.

LGTM

@hittythittyt left a comment

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.

LGTM

@jwx0925
jwx0925 merged commit f037b04 into opensandbox-group:mainMar 24, 2026
11 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

featureNew feature or requestsdk/java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ninan-nn@hittyt@jwx0925@Pangjiping