python-sonic-client icon indicating copy to clipboard operation
python-sonic-client copied to clipboard

Close connection when exception is raised

Open athoune opened this issue 5 years ago • 0 comments

Describe the bug When server returns error, client doesn't close socket.

ResourceWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.7/socket.py:660: ResourceWarning: unclosed <socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.27.0.3', 42192), raddr=('172.27.0.2', 1491)>
  self._sock = None

Expected behavior connection is closed before raising the error.

athoune avatar Jan 30 '20 18:01 athoune