Skip to content
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

AWSHTTPClient.shutdown doesn't state Sendable callback #621

Closed
vojtarylko opened this issue Oct 3, 2022 · 7 comments
Closed

AWSHTTPClient.shutdown doesn't state Sendable callback #621

vojtarylko opened this issue Oct 3, 2022 · 7 comments

Comments

@vojtarylko
Copy link

Current AWSHTTPClient.shutdown doesn't require Sendable callback:

func shutdown(queue: DispatchQueue, _ callback: @escaping (Error?) -> Void)

but corresponding function in HTTPClient does.

This fails the compilation with (on Swift 5.6)

soto-core/Sources/SotoCore/HTTP/AsyncHTTPClient.swift:21:1: error: type 'HTTPClient' does not conform to protocol 'AWSHTTPClient'
extension AsyncHTTPClient.HTTPClient: AWSHTTPClient {
^
async-http-client/Sources/AsyncHTTPClient/HTTPClient.swift:198:33: note: candidate has non-matching type '(DispatchQueue, @escaping @Sendable (Error?) -> Void) -> ()'

    @preconcurrency public func shutdown(

soto-core/Sources/SotoCore/HTTP/AWSHTTPClient.swift:57:10: note: protocol requires function 'shutdown(queue:_:)' with type '(DispatchQueue, @escaping (Error?) -> Void) -> ()'
    func shutdown(queue: DispatchQueue, _ callback: @escaping (Error?) -> Void)

or produces warning (on Swift 5.7)

sendability of function types in instance method 'shutdown(queue:_:)' does not match requirement in protocol 'AWSHTTPClient'
@adam-fowler
Copy link
Member

What version of Soto are you using?

@vojtarylko
Copy link
Author

I'm using 6.1.2.

@adam-fowler
Copy link
Member

And what version of SotoCore are you using. Maybe you need to run a package update. I've been compiling with both 5.6 and 5.7 for ages without issue.

@adam-fowler
Copy link
Member

The latest async-http-client set that callback to be Sendable, which is really a breaking change for swift 5.6 and shouldn't have been implemented. swift-log did the same thing as well. I think this is general teething problems with adopting Sendable. I'll fix it for Soto as well

@adam-fowler
Copy link
Member

This should be fixed by soto-project/soto-core#518 when it gets merged. I would like to get the NIOLock warnings fixed as well before doing a merge, but swift-nio missed one method, which has just been rectified. Once they include that in a release I can do a release for SotoCore

@vojtarylko
Copy link
Author

@adam-fowler Thanks for the fix!

@adam-fowler
Copy link
Member

Fixed in v6.1.3

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

No branches or pull requests

2 participants