Skip to content

Comments

Fix math verify timeout#620

Merged
willccbb merged 5 commits intomainfrom
fix-math-verify-timeout
Dec 11, 2025
Merged

Fix math verify timeout#620
willccbb merged 5 commits intomainfrom
fix-math-verify-timeout

Conversation

@mikasenghaas
Copy link
Member

Description

math-verify uses handlers with signal.alarm to implement parsing and verification timeouts. These may cause race conditions in async contexts. This PR updates the MathRubric class to avoid this issue:

  • Passes None as timeout to all math_verify function so that internal timeouts are not used
  • Runs all synchronous blocking operations with asyncio.to_thread(...)
  • Implements a global timeout using asyncio.wait_for(...)
    Adds basic tests to ensure that timeouts are enforced correctly.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test improvement

Testing

  • All existing tests pass when running uv run pytest locally.
  • New tests have been added to cover the changes

Checklist

  • My code follows the style guidelines of this project as outlined in AGENTS.md
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

@willccbb willccbb marked this pull request as ready for review December 11, 2025 09:37
@willccbb willccbb merged commit eec990c into main Dec 11, 2025
4 checks passed
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