| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add timeout support to server-side pygit2 clone and fetch operations via asyncio.wait_for. Wire existing POLICY_REPO_CLONE_TIMEOUT config into GitPolicyFetcher. Re-raise errors from _clone() instead of silently swallowing them so callers can handle failures properly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sorry, something went wrong.
✅ Deploy Preview for opal-docs canceled.
|
Sorry, something went wrong.
| ) | ||
| try: | ||
| repo: Repository = await run_sync( | ||
| repo: Repository = await run_sync_with_timeout( |
There was a problem hiding this comment.
We need to make sure that in case of a timeout, we actually terminate the Git subprocess
Sorry, something went wrong.
| datetime.datetime.now() | ||
| ) | ||
| try: | ||
| await run_sync_with_timeout( |
There was a problem hiding this comment.
Timeout should be for the entire sync procedure, not individually fetch and clone. That would naturally double the actual timeout
Sorry, something went wrong.
| return False | ||
| return last_fetched > t | ||
|
|
||
| async def fetch_and_notify_on_changes( |
There was a problem hiding this comment.
We should instrument this function
Sorry, something went wrong.
| async def run_sync_with_timeout( | ||
| func: Callable[P_args, T_result], | ||
| *args: P_args.args, | ||
| timeout: Optional[float] = None, |
There was a problem hiding this comment.
if the upstream function have "timeout" kwarg then you can't pass it to it, make it more unique
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Linear Issue
https://linear.app/permit/issue/PER-13817/fix-git-clonefetch-operations-hanging-indefinitely-on
Tests
Test plan
🤖 Generated with Claude Code