You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Precondition failed: BUG DETECTED: wait() must not be called when on an EventLoop.
Calling wait() on any EventLoop can lead to
- deadlocks
- stalling processing of other connections (Channels) that are handled on the EventLoop that wait was called on
Further information:
- current eventLoop: Optional(SelectableEventLoop { selector = Selector { descriptor = 29 }, thread = NIOThread(name = NIO-ELT-1-#0), scheduledTasks = PriorityQueue(count: 0): [] })
- event loop associated to future: SelectableEventLoop { selector = Selector { descriptor = 45 }, thread = NIOThread(name = NIO-ELT-2-#0) }: file SwiftyRequest-CouchDB/.build/checkouts/Kitura-NIO/Sources/KituraNet/ClientRequest.swift, line 592
2021-03-15 11:55:50.415669+0100 SwiftyRequest-CouchDB[34611:5062052] Precondition failed: BUG DETECTED: wait() must not be called when on an EventLoop.
Calling wait() on any EventLoop can lead to
- deadlocks
- stalling processing of other connections (Channels) that are handled on the EventLoop that wait was called on
Further information:
- current eventLoop: Optional(SelectableEventLoop { selector = Selector { descriptor = 29 }, thread = NIOThread(name = NIO-ELT-1-#0), scheduledTasks = PriorityQueue(count: 0): [] })
- event loop associated to future: SelectableEventLoop { selector = Selector { descriptor = 45 }, thread = NIOThread(name = NIO-ELT-2-#0) }: file SwiftyRequest-CouchDB/.build/checkouts/Kitura-NIO/Sources/KituraNet/ClientRequest.swift, line 592
Example
letrestRequest=RestRequest(method:.get, url:"RestApiUrl.json")
restRequest.responseObject(){(restResponse:Result<RestResponse<RestApiDocument>,RestError>)in
switch restResponse {case.success(let result):
if let document = result.body {self.services.couchDBService.retrieveDB("database"){(database, error)in
guard let database = database else{Log.error("Database not found")return}
database.create(document){(databaseResponse, error)in
if databaseResponse !=nil{Log.info("Successful created: \(String(describing: databaseResponse?.id))")}}}}case.failure(let error):Log.error("Client request failed with \(error)")}}
The text was updated successfully, but these errors were encountered:
Description
When I load a json document with SwiftyRequest and then want to save it to CouchDB I get a
BUG DETECTED: wait()
error message from NIO.Xcode stops the execution here:
https://github.com/apple/swift-nio/blob/main/Sources/NIO/EventLoopFuture.swift#L913
Environment Details
macOS 11.2.3
Xcode 12.4
Swift 5.3.2
Kitura 2.9.200
Kitura-NIO 2.4.200
SwiftyRequest 3.2.200
Kitura-CouchDB 3.2.0
Error message
Example
The text was updated successfully, but these errors were encountered: