Add benchmark queue improvements: cancel, clear, timeout, status#12
Add benchmark queue improvements: cancel, clear, timeout, status#12adriangb wants to merge 2 commits intoalamb:mainfrom
Conversation
…display - poll.sh: Run jobs with setsid for killable process groups, write .started marker files with timestamp and PID, handle cancelled jobs gracefully - scrape_comments.py: Add cancel benchmark, clear benchmark queue commands, enhance queue display with Started/Status columns showing elapsed time - gh_compare_branch.sh: Add 25-minute timeout per benchmark run - gh_compare_branch_bench.sh: Add timeout and pre-compilation step - gh_compare_arrow.sh: Add timeout and pre-compilation step Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
cc @Dandandan |
Adds a new "cancel benchmarks" (plural, no argument) command that cancels all queued and running benchmark jobs for the PR where the comment is posted. Restricted to ALLOWED_USERS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Thank you for this PR Posting some comments from Discord: this is probably fine but I don't think I will have tome to review it anytime soon. The issue is I have no good way to test changes to the benchmark runner and without that I don't want to break the runner / actively running scripts. Maybe someone can help writing some tests so that we would have a better ability to evaluate changes |
PR #12 Review: Benchmark queue improvements (cancel, clear, timeout, status)The PR is well-structured and the overall approach is sound. Here are my observations: poll.shRace condition in setsid bash "$job" &
JOB_PID=$!
echo "$(date -u ...) $JOB_PID" > "${job}.started" # <-- window here
wait $JOB_PID 2>/dev/null || trueThere's a brief window between backgrounding the job and writing No SIGKILL escalation scrape_comments.py
parts = re.split(r"[_\-]", name_no_ext)
if comment_id in parts:Arrow job names are
Timeout handling in shell scriptsThe timeout+ The One nit on Minor nits
Summary
The main actionable items are: (1) clarify/fix the global scope of 🤖 Generated with Claude Code |
|
I think I’ll abandon this in favor of a more holistic solution: #13 |
Summary
setsidfor killable process groups; write.startedmarker files containing ISO timestamp + PID; handle cancelled jobs (file removed mid-run) gracefullycancel benchmark <id_or_url>,cancel benchmarks, andclear benchmark queuecommands (allowed users only); enhanceshow benchmark queuetable with Started and Status columns showing elapsed time for running jobs; add stale.startedfile cleanup when PID is deadBENCHMARK_TIMEOUT) per benchmark run; on timeout, skip to next benchmark--no-runpre-compilation step to separate compile from execution--no-runpre-compilation stepNew Commands
cancel benchmark <comment_id>— Cancel a queued or running benchmark by comment ID (numeric,#issuecomment-NNNURL, or API URL). Kills running process group via SIGTERM.cancel benchmarks— Cancel all queued and running benchmark jobs for the PR where the comment is posted. Reports counts of running and queued jobs cancelled.clear benchmark queue— Remove all queued (non-running) jobs. Skips currently running jobs.Test plan
poll.shcreates.startedfiles on job start and removes them on completionshow benchmark queuedisplays Started time and elapsed for running jobs, "queued" for waiting jobscancel benchmark <id>removes queued job filescancel benchmark <id>kills running benchmarks via process group and removes filescancel benchmarkson a PR with no jobs → "No benchmark jobs found"cancel benchmarkson a PR with queued jobs → removes them, reports countcancel benchmarkson a PR with running jobs → kills process group, removes files, reports countcancel benchmark <id>still works (singular form unchanged)clear benchmark queueremoves all non-running jobs and reports countstimeoutcommand works on the benchmark machine (Linux, GNU coreutils)cargo bench --no-runcompiles without running for criterion benchmarks🤖 Generated with Claude Code