asyncdispatch: activeDescriptors
, shouldAcceptRequest
doesn't work
#16603
Labels
Async
Everything related to Nim's async
While looking into the asynchttpserver example (eg #16599 + recent PR's), I noticed that
activeDescriptors
(and henceshouldAcceptRequest
) doesn't seem to work.Example
Current Output
Error: unhandled exception: Too many open files
is raised after < 1 second, eg:Expected Output
works
Additional Information
1.5.1 d2f4f25
Not sure how to fix this.=> see RFC nim-lang/RFCs#382
notes
Using
await sleepAsync(500)
doesn't change anything (still crashes the server), the problem is thatactiveDescriptors
, and henceshouldAcceptRequest
, is incorrect (under-reports).note that if you comment out
await sleepAsync(20000)
, it'll still crash but will take more time to crash it, eg this will crash it:for i in {1..2000}; do curl localhost:8080/&; ; done
with:
and then crashes
using
let ok = server.shouldAcceptRequest()
instead oflet ok = server.shouldAcceptRequest(assumedDescriptorsPerRequest = 1)
(ie, using the default 5) doesn't helplinks
The text was updated successfully, but these errors were encountered: