Skip to content

UDP listeners leak. #1

@jrwren

Description

@jrwren

I noticed this using uwsgi to host our application. Now I do not think it is uwsgi related.

lsof -p <mypid> shows many UDP listeners

...
uwsgi_pyt 8855 myapp 1014u  IPv4           61164162      0t0      UDP *:37440
uwsgi_pyt 8855 myapp 1015u  IPv4           61164204      0t0      UDP *:50661
uwsgi_pyt 8855 myapp 1016u  IPv4           61165045      0t0      UDP *:59752
uwsgi_pyt 8855 myapp 1017u  IPv4           61164224      0t0      UDP *:49717
uwsgi_pyt 8855 myapp 1018u  IPv4           61164375      0t0      UDP *:46519
uwsgi_pyt 8855 myapp 1019u  IPv4           61164441      0t0      UDP *:47617
uwsgi_pyt 8855 myapp 1020u  IPv4           61165421      0t0      UDP *:50587
uwsgi_pyt 8855 myapp 1021u  IPv4           61165334      0t0      UDP *:48802
uwsgi_pyt 8855 myapp 1022u  IPv4           61165425      0t0      UDP *:40760
uwsgi_pyt 8855 myapp 1023u  IPv4           61165372      0t0      UDP *:47147
...

The per request StatsClient object may get garbage collected, but the socket listener resource is never cleaned up. This ultimately causes us to run out of file descriptors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions