Skip to content

[6.2] Async git repository opening (#8721) #8853

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

Conversation

plemarquand
Copy link
Contributor

The RepositoryProvider protocol's open method is defined as
synchronous. Convert this to async to avoid concurrency workarounds in
clients that might be prone to deadlocks.

This involved porting RepositoryManager.lookup to structured
concurrency. The method has some concurrency constraints that are
preserved:

  • There is a limit (maxConcurrentOperations) on how many simultaneous
    lookups can be performed concurrently.
  • If a lookup is requested and one is in flight for the same
    RepositorySpecifier, the in flight request completes before the new
    one is started.

The `RepositoryProvider` protocol's `open` method is defined as
synchronous. Convert this to `async` to avoid concurrency workarounds in
clients that might be prone to deadlocks.

This involved porting `RepositoryManager.lookup` to structured
concurrency. The method has some concurrency constraints that are
preserved:

- There is a limit (`maxConcurrentOperations`) on how many simultaneous
lookups can be performed concurrently.
- If a lookup is requested and one is in flight for the same
`RepositorySpecifier`, the in flight request completes before the new
one is started.
@plemarquand
Copy link
Contributor Author

@swift-ci please test

@plemarquand plemarquand changed the title [6.2] Async git repository opening (https://github.com/swiftlang/swift-package-manager/pull/8721) [6.2] Async git repository opening (#8721) Jun 20, 2025
@plemarquand
Copy link
Contributor Author

@swift-ci test macos

@plemarquand plemarquand merged commit 89bf98f into swiftlang:release/6.2 Jun 20, 2025
6 checks passed
@plemarquand plemarquand deleted the async-repo-opening-6.2 branch June 20, 2025 19:17
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.

3 participants