Skip to content

TimedCertificateReloader is using blocking I/O instead of NIOFileSystem #297

@weissi

Description

@weissi

guard let bytes = FileManager.default.contents(atPath: path) else {

The public func reload() throws is clearly not right, it needs to be public func reload() async throws because we cannot guarantee that the file I/O is synchronous. In fact in the places where this is useful, it's quite likely that the orchestrator is using a virtualised networked filesystem which is very much not synchronous.

The whole implementation needs to be vetted for Foundation usage which does blocking I/O. If (for the time being whilst NIOFileSystem is still _NIOFileSystem) we need a temporary solution, then the blocking calls need to absolutely be offloaded to a NIOThreadPool` to be guaranteed not to run on the EventLoops or the Swift Concurrency threads

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions