Skip to content

Subscribing to a thread whose worktree was removed records failed Git spawn spans #39291

Closed

Description

@mInrOz

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Run a server that exports traces over OTLP.
  2. Open a thread that has its own worktree, so the client subscribes to its branch or status.
  3. Delete the worktree directory, then reload or reconnect the client so it subscribes again.
  4. Open the trace for that subscribeVcsBranch or subscribeVcsStatus call.

Expected behavior

Subscribing to a thread whose worktree is gone records no error spans. The server already treats it as "not a repository".

Actual behavior

Every subscription records three failed spans: GitWorkflowService.headPath, runGitCommand and NonBlockingSpawner.spawn. They read Failed to spawn Git process / NotFound: FileSystem.access (<worktree path>).

Each subscription starts the HEAD watch, which calls GitWorkflowService.headPath(cwd) (VcsStatusBroadcaster.watchHead). headPath runs git rev-parse --git-path HEAD through GitVcsDriverCore.execute, which spawns Git with the missing directory as its working directory. The spawner's FileSystem.access(cwd) check fails before Git starts. headPath turns that into null, so the watch ends as intended, but the traced spans have already ended as errors.

Repository detection in the same trace has no error: GitVcsDriver.probeWorkTree runs git -C <cwd> from the server's own directory and checks that the cwd exists.

Impact

Minor bug or occasional failure

Version or commit

main @ 80cf4f7

Environment

Linux, Node server with OTLP trace export; independent of provider and client.

Logs or stack traces

GitWorkflowService.headPath: Git command failed in GitWorkflowService.headPath (<removed worktree>): Failed to spawn Git process.
runGitCommand: Git command failed in GitWorkflowService.headPath (<removed worktree>): Failed to spawn Git process.
NonBlockingSpawner.spawn: NotFound: FileSystem.access (<removed worktree>)

Workaround

None needed for users; it is trace noise.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions