Skip to content

Add WaitDelay to command executions for improved timeout handling#1332

Closed
ije wants to merge 1 commit into
mainfrom
cmd-wait-delay
Closed

Add WaitDelay to command executions for improved timeout handling#1332
ije wants to merge 1 commit into
mainfrom
cmd-wait-delay

Conversation

@ije

@ije ije commented Mar 17, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings March 17, 2026 00:56

Copilot AI 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.

Pull request overview

This PR adds exec.Cmd.WaitDelay to several external command executions to reduce the risk of indefinite blocking during command completion, and enhances the /status.json output with per-task timing information.

Changes:

  • Add WaitDelay to deno, git, and cjs-module-lexer command executions.
  • Add a duration field to /status.json build queue entries.
  • Refactor cjsModuleLexer execution to remove the previous context-based timeout.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
server/router.go Adds build task duration to /status.json output for better observability.
server/loader.go Sets cmd.WaitDelay for the deno run loader invocation.
server/git.go Sets cmd.WaitDelay for git ls-remote calls.
server/cjs_module_lexer.go Adds cmd.WaitDelay to deno fallback and cjs-module-lexer runs, and removes the prior context.WithTimeout usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread server/router.go
Comment on lines +293 to 295
"duration": time.Since(t.startedAt).String(),
"path": t.ctx.Path(),
"status": t.ctx.status,
Comment on lines +140 to +143
cmd := exec.Command(path.Join(config.WorkDir, fmt.Sprintf("bin/cjs-module-lexer-%s", cjsModuleLexerVersion)), path.Join(b.esmPath.PkgName, cjsEntry))
cmd.Dir = b.wd
cmd.WaitDelay = 30 * time.Second
cmd.Env = append(os.Environ(), "NODE_ENV="+b.getNodeEnv())
@ije ije closed this Mar 17, 2026
@ije ije deleted the cmd-wait-delay branch March 17, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants