Hang risk when running on iOS as a file server
tomisacat opened this issue · 2 comments
tomisacat commented
Describe the bug
I'm trying to embed Vapor into an iOS app as file server following the tutorial from Running a Web Server on iOS with Vapor | Kodeco, but encountered hang risk when running app:
The full warning report is:
Thread Performance Checker: Thread running at QOS_CLASS_USER_INTERACTIVE waiting on a lower QoS thread running at QOS_CLASS_DEFAULT. Investigate ways to avoid priority inversions
To Reproduce
Steps to reproduce the behavior:
- Add package with Xcode built-in package manager
- Initialize
Application
and start
init(port: Int) {
self.port = port
app = Application(.production)
configure(app)
}
private func configure(_ app: Application) {
app.http.server.configuration.hostname = "0.0.0.0"
app.http.server.configuration.port = port
app.views.use(.leaf)
app.leaf.cache.isEnabled = app.environment.isRelease
app.leaf.configuration.rootDirectory = Bundle.main.bundlePath
app.routes.defaultMaxBodySize = "50MB"
}
func start() {
Task(priority: .high) {
do {
try app.start()
} catch {
fatalError(error.localizedDescription)
}
}
}
- Call
start
when app launch, and the error will prompted out.
Expected behavior
No hang risk, just like running Vapor as a server side app.
Environment
- Vapor Framework version: 4.77.0
- Vapor Toolbox version: 18.7.1
- OS version: 13.3.1
Additional context
No
0xTim commented
This is a dupe of apple/swift-nio#2223 and an issue inside NIO - not something we can control unfortunately