Closed andreasley closed 2 months ago
The problem originates here:
When closing the channel with mode .input
, the function doShutdown()
is never called on the NIOSSL.SSLConnection
.
Setting mode to .all
fixes this.
The same may apply to onCancel
.
I still find SwiftNIO fairly confusing, so I'm not sure if that's a suitable fix. ;)
Can I ask you to try two different things, separately and together 1) When you create your Application add an additional channel handler
let app = Application(
router: router,
server: http1(additionalChannelHandlers: [IdleStateHandler(readTimeout: .seconds(15))])
)
2) Can you try using the quiescing-helper
branch of Hummingbird and see if that helps with the shutdown
IdleStateHelper
like in the following snippet (to still use TLS) didn't help:var app = Application(
router: Router(),
server: try .tls(.http1(additionalChannelHandlers: [IdleStateHandler(readTimeout: .seconds(15))]), tlsConfiguration: tlsConfiguration),
configuration: .init(address: .hostname(hostname, port: port))
)
Using both changes, the app also shut down properly.
Commit: 2.0-rc.1 Environment: macOS (issue happens for both BSD sockets and Transport Services)
Issue: Graceful shutdown never completes if the server is using TLS and a connection is still open.
The following code demonstrates the issue by doing the following:
socket
(without sending any data)