Add WaitDelay to command executions for improved timeout handling#1332
Closed
ije wants to merge 1 commit into
Closed
Add WaitDelay to command executions for improved timeout handling#1332ije wants to merge 1 commit into
WaitDelay to command executions for improved timeout handling#1332ije wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
WaitDelaytodeno,git, andcjs-module-lexercommand executions. - Add a
durationfield to/status.jsonbuild queue entries. - Refactor
cjsModuleLexerexecution 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 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()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.