MagicStack/uvloop

Set thread name prefix for default event loop thread pool

inikolaev opened this issue · 0 comments

  • uvloop version: 0.17.0
  • Python version: 3.11
  • Platform: any
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?:
  • Does uvloop behave differently from vanilla asyncio? How?: When creating a default thread pool uvloop does not set thread name prefix

It would be great to set thread name prefix for a default thread pool used by uvloop. For example the default asyncio loop sets it to asyncio, so for uvloop it could be set to uvloop. It's useful for debugging and for example in DataDog flame graph it makes it easier to identify uvloop threads in this case. Right now it looks like this:

image

As I understand it should be pretty straightforward change and I could make a PR if there are no objections.