ClientBootstrap.connect(host:port:) and @unchecked Sendable

as is well-known the 5.10 compiler closes some holes in the concurrency checking, which has the practical implication of surfacing a sizeable new generation of ClientBootstrap-related warnings.

refactoring the code base so that ClientBootstrap never goes near a Swift actor is not realistic, because we are using a lot of Swift actors, so i am thinking we take the types that wrap ClientBootstrap and marking them @unchecked Sendable.

from cursory inspection, these types are only calling the connect(host:port:) method on the bootstraps. is it a good idea to mark these @unchecked Sendable?

So long as your usage here is safe, and you aren't subsequently modifying the type, then yes.

1 Like