Skip to content

Commit de7f118

Browse files
committed
statsd: explicit socket shutdown before GC
1 parent 598745c commit de7f118

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gunicorn/instrument/statsd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def __init__(self, cfg):
3535
self.sock = socket.socket(address_family, socket.SOCK_DGRAM)
3636
self.sock.connect(cfg.statsd_host)
3737
except Exception:
38+
self.sock.close()
3839
self.sock = None
3940

4041
self.dogstatsd_tags = cfg.dogstatsd_tags

0 commit comments

Comments
 (0)