Skip to content

exit if ctx is cancelled while waiting on read lock #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged

Conversation

asiyani
Copy link
Contributor

@asiyani asiyani commented Apr 25, 2025

No description provided.

asiyani added 2 commits April 25, 2025 13:24
git operations like `fetch` are slower and its called
under Mirror() which grabs write lock on repository.
Because of this functions like `Hash` can be waiting
for read lock for a long time and during that time
its given ctx can be cancelled.

If ctx is already cancelled then waiting on Rlock()
is waste of time since call to `runGitCommand(ctx, ...)` will fail anyway.
@asiyani asiyani merged commit 095e01b into main Apr 25, 2025
11 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