Skip to content

Conversation

djeebus
Copy link
Contributor

@djeebus djeebus commented Sep 22, 2025

Each sandbox creation will result in (up to) 3 traces:

This should help us break down where the time is being spent, and what it's doing.

# Conflicts:
#	packages/api/go.mod
#	packages/client-proxy/go.mod
#	packages/orchestrator/go.mod
#	packages/orchestrator/go.sum
#	packages/orchestrator/internal/sandbox/block/chunk.go
#	packages/orchestrator/internal/sandbox/build/cache.go
#	packages/orchestrator/internal/sandbox/checks.go
#	packages/orchestrator/internal/sandbox/nbd/dispatch.go
#	packages/orchestrator/internal/sandbox/nbd/path_direct.go
#	packages/orchestrator/internal/sandbox/rootfs/nbd.go
#	packages/orchestrator/internal/sandbox/sandbox.go
#	packages/orchestrator/internal/server/sandboxes.go
#	packages/shared/go.mod
#	packages/shared/pkg/storage/storage_fs.go
#	scripts/golang-dependencies-integrity.sh
# Conflicts:
#	packages/orchestrator/cmd/mock-nbd/mock.go
#	packages/orchestrator/internal/sandbox/block/tracker.go
#	packages/orchestrator/internal/sandbox/build/build.go
#	packages/orchestrator/internal/sandbox/build/cache_test.go
#	packages/orchestrator/internal/sandbox/nbd/dispatch.go
#	packages/orchestrator/internal/sandbox/sandbox.go
#	packages/orchestrator/internal/sandbox/uffd/handler.go
# Conflicts:
#	packages/orchestrator/internal/sandbox/build/build.go
#	packages/orchestrator/internal/sandbox/build/cache_test.go
cursor[bot]

This comment was marked as outdated.

@djeebus djeebus added the improvement Improvement for current functionality label Sep 22, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Shared Context Causes Premature Cancellation

The ResumeSandbox function expects distinct contexts for setup/tracing and long-running operations. Passing the same context for both merges their lifecycle and cancellation behavior, which can lead to incorrect tracing and premature cancellation of sandbox operations.

packages/orchestrator/internal/template/build/layer/resume_sandbox.go#L32-L34

) (*sandbox.Sandbox, error) {
sbx, err := sandbox.ResumeSandbox(
ctx, ctx,

Fix in Cursor Fix in Web


@djeebus
Copy link
Contributor Author

djeebus commented Sep 22, 2025

Cursor's point is probably invalid, but the code doesn't make it quite clear. The parallel spans probably need some refactoring to go with it, I'll give it a shot before we merge this.

@djeebus djeebus marked this pull request as draft September 22, 2025 18:03
# Conflicts:
#	packages/orchestrator/internal/sandbox/build/cache_test.go
#	packages/orchestrator/internal/sandbox/sandbox.go
#	packages/shared/pkg/storage/storage_cache.go
# Conflicts:
#	packages/orchestrator/internal/sandbox/envd.go
#	packages/orchestrator/internal/sandbox/sandbox.go
#	packages/orchestrator/internal/sandbox/template/cache.go
#	packages/orchestrator/internal/sandbox/uffd/handler.go
#	packages/orchestrator/internal/server/sandboxes.go
#	packages/orchestrator/internal/template/build/layer/resume_sandbox.go
# Conflicts:
#	packages/orchestrator/internal/sandbox/envd.go
the conflicts aren't worth it
@djeebus
Copy link
Contributor Author

djeebus commented Oct 8, 2025

Closing this until tracing is perfect

@djeebus djeebus closed this Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant