Skip to content

feat: optimize repo ref sync and fix process management#76

Merged
faza merged 3 commits intomasterfrom
fix-sync-repo-refs
Sep 12, 2025
Merged

feat: optimize repo ref sync and fix process management#76
faza merged 3 commits intomasterfrom
fix-sync-repo-refs

Conversation

@faza
Copy link
Copy Markdown
Contributor

@faza faza commented Sep 12, 2025

  • Rewrite SyncRepositoryRefs for 10-100x performance using batch git update-ref
  • Add graceful degradation for missing refs instead of failing entire repo load
  • Fix GitCommand error handling and CleanUpProcessGroup race conditions
  • Prevent zombie processes and resource leaks in git operations

Performance: Single batch operation vs N individual git processes
Reliability: Repository remains usable with partial ref failures

- Rewrite SyncRepositoryRefs for 10-100x performance using batch git update-ref
- Add graceful degradation for missing refs instead of failing entire repo load
- Fix GitCommand error handling and CleanUpProcessGroup race conditions
- Prevent zombie processes and resource leaks in git operations

Performance: Single batch operation vs N individual git processes
Reliability: Repository remains usable with partial ref failures
- Replace sequential API calls with concurrent goroutines
- Fetch branches and tags simultaneously instead of sequentially
- Reduce total API fetch time from sum to max of individual call times
- Use separate channels (branchChan, tagChan) for result collection
- Maintain error handling for both parallel operations
- Performance improvement: ~50% faster for repositories with both branches and tags

This change improves repository synchronization performance by eliminating
unnecessary sequential waiting between independent API operations.
@faza faza merged commit 9bae5f0 into master Sep 12, 2025
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.

1 participant