apple / apple/swift-nio-ssh

Concurrency warning in example server: Conformance of 'NIOSSHHandler' to 'Sendable' is unavailable

Open
#207 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
515
Forks
85
PR merge metrics
No merged PRs in 30d

Description

I'm experimenting with porting a simple server app I'm working on from the (quite nice) Citadel wrapper library to use `NIOSSH` directly. I've got it basically working, but I get a concurrency warning that says it will be an error in Swift 6 mode.

It seems that the `ChannelPipeline.addHandler` method used in the [example server app](https://github.com/apple/swift-nio-ssh/blob/main/Sources/NIOSSHServer/main.swift#L89) wants its `handlers` input to be `[ChannelHandler & Sendable]`, but the `NIOSSHHandler` type is [explicitly marked as non-`Sendable`](https://github.com/apple/swift-nio-ssh/blob/main/Sources/NIOSSH/NIOSSHHandler.swift#L91-L92).

It looks like there were some updates to that type related to strict concurrency in https://github.com/apple/swift-nio-ssh/pull/196 - is it possible that the type is now effectively `Sendable` if the availability annotation were removed? I don't know enough about the internals here to have a clue, but perhaps a maintainer would.

Contributor guide

Open the contributing guide

Research direction

Start with Sources/NIOSSHServer/main.swift around the example server's ChannelPipeline.addHandler call and Sources/NIOSSH/NIOSSHHandler.swift around its Sendable annotation. Review the strict-concurrency changes from pull request 196 and determine whether the example can use NIOSSHHandler without the Swift 6 warning. Done means the example builds without this warning and the handler's concurrency declaration remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.