Skip to content

GunicornWebWorker: spam logs every second in debug mode #712

@MarSoft

Description

@MarSoft

When I use GunicornWebWorker and enable asyncio debug mode (loop.set_debug(True)), I get messages like this logged nearly every second when the server is idle:

INFO:asyncio:poll 999.470 ms took 1001.159 ms: timeout

I investigated the issue, and seems that it will print such messages anytime if you call sleep(1) with delay of 1 second or more if no other IO happens during that delay.

GunicornWebWorker uses exactly 1 second for delay in idle mode: https://github.com/KeepSafe/aiohttp/blob/master/aiohttp/worker.py#L97
And asyncio switches such messages from DEBUG to INFO loglevel when delay is >= 1 second: https://github.com/python/cpython/blob/master/Lib/asyncio/base_events.py#L1242

Is it possible to avoid such messages somehow, while leaving other asyncio diagnostic messages like ones about abandoned (not-called) subroutines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions