Skip to content

fix: subprocess isolate to close timeout-immune tree-sitter hang#1290

Open
seroperson wants to merge 1 commit into
entrius:testfrom
seroperson:treesitter-security
Open

fix: subprocess isolate to close timeout-immune tree-sitter hang#1290
seroperson wants to merge 1 commit into
entrius:testfrom
seroperson:treesitter-security

Conversation

@seroperson
Copy link
Copy Markdown
Contributor

Closes #1289

Summary

  • Run the per-PR parse + cursor walk in a spawn-context multiprocessing.Pool(processes=1) with a hard SCORING_SUBPROCESS_BUDGET_S = 5.0s wall-clock. On timeout or worker crash the worker is killed and the PR is zero-scored with scoring_method='skipped-isolation-timeout'; the round continues.
  • Register an atexit hook (isolated_scoring.shutdown) so the multiprocessing resource_tracker does not log spurious leaked-semaphore warnings.

Follow-up to #1276.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
  • Manually tested

Existing tests cover the subprocess isolation, but I've added several more to ensure timeout hanging works correctly.

@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label May 15, 2026
@seroperson seroperson force-pushed the treesitter-security branch from fe4f8f4 to 69fbd9e Compare May 15, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: subprocess-isolate scoring to close timeout-immune tree-sitter hangs

1 participant