vapor/vapor

Crash after installing posix ELG as concurrency executor

Closed this issue · 1 comments

Describe the issue

Crash after installing posix ELG as concurrency executor.

Quoting Johannes:

Letting NIO take over the Concurrency thread pool is important for performance. We saw roughly 30% improvements on Linux for non-I/O code and much more for I/O code.

Vapor version

4.94.1

Operating system and version

macOS 14.4

Swift version

Swift 5.10 RELEASE

Steps to reproduce

Add this code (also import NIO) to the Entrypoint in the bare Vapor template:

if NIOSingletons.unsafeTryInstallSingletonPosixEventLoopGroupAsConcurrencyGlobalExecutor() {
    print("*** installed posix 'EventLoopGroup' as concurrency global executor")
} else {
    print("*** FAILED to install posix 'EventLoopGroup' as concurrency global executor")
}
Screenshot 2024-04-29 at 2 02 54 PM

Outcome

Crash at Application.execute():

Screenshot 2024-04-29 at 2 03 27 PM

Additional notes

No response

0xTim commented

See #3168 which should solve the issue