squeaky-pl / japronto

Screaming-fast Python 3.5+ HTTP toolkit integrated with pipelining HTTP server based on uvloop and picohttpparser.
MIT License
8.61k stars 581 forks source link

Assertion `(unsigned) fd < loop->nwatchers' failed. #128

Closed kolobovdg closed 5 years ago

kolobovdg commented 6 years ago

I have an error like

python: src/unix/linux-core.c:336: uv__io_poll: Assertion `(unsigned) fd < loop->nwatchers' failed.
Fatal Python error: Aborted

This problem only if I use workers > 1. There is handler, that return a fixed response like

async def status(request):
    return request.Response(text="OK", code=200)

Any ideas?

Regards Dmitrij

squeaky-pl commented 6 years ago

By the looks of it, it's an assertion that fails in libuv, so this coulud be potentially a bug in libuv or uvloop itself.

One more thing, do you do any operations on the loop before starting the server?

squeaky-pl commented 6 years ago

I think this is linked to this bug, https://github.com/MagicStack/uvloop/issues/100

So basically to solve this somebody needs to contribute support for newer uvloop versions (0.9.0+). Japronto currently works only with 0.8 series of uvloop.

squeaky-pl commented 5 years ago

This should be solved by now as Japronto runs on latest uvloop versions as of now. Feel free to reopen if the issue persists.