Skip to content

Use async HTTPClient in BinaryArtifactsManager #8087

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 6 commits into from
Nov 4, 2024

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Oct 31, 2024

Motivation:

To adopt Swift concurrency in ManifestLoader, we need to convert RegistryClient first, which then would require use of HTTPClient instead of LegacyHTTPClient. That would also cascade to BinaryArtifactsManager, so I'm starting there first to make PRs smaller.

Modifications:

Converted (and as a consequence, simplified) code in Workspace+BinaryArtifacts.swift, also adopted HTTPClient in WorkspaceTests to fix tests after the change.

Converted some error diagnostics to conform to Error, which makes control flow with ObservabilityScope.trap wrapper easier to write and read.

Result:

One major previous adopter of LegacyHTTPClient is now compatible with Swift concurrency.

Since BinaryArtifactsManager was blocking Swift concurrency thread pool and also used .sharedConcurrent dispatch queue, this potentially fixes thread explosion/deadlocks that may have been caused by previously broken code.

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) October 31, 2024 18:46
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test linux

@bnbarham
Copy link
Contributor

bnbarham commented Nov 1, 2024

@swift-ci test linux

@MaxDesiatov MaxDesiatov merged commit 8021081 into main Nov 4, 2024
5 checks passed
@MaxDesiatov MaxDesiatov deleted the maxd/async-binary-artifacts branch November 4, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants