-
Notifications
You must be signed in to change notification settings - Fork 180
Straighten out tracing #1235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Straighten out tracing #1235
Conversation
# 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
There was a problem hiding this 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
infra/packages/orchestrator/internal/template/build/layer/resume_sandbox.go
Lines 32 to 34 in 7edb7f2
) (*sandbox.Sandbox, error) { | |
sbx, err := sandbox.ResumeSandbox( | |
ctx, ctx, |
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. |
# 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
# Conflicts: # packages/orchestrator/internal/server/sandboxes.go
# Conflicts: # packages/orchestrator/go.mod # packages/orchestrator/internal/sandbox/template/cache.go # packages/shared/pkg/storage/storage_fs.go
Closing this until tracing is perfect |
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.