Skip to content

Commit 920083b

Browse files
committed
Fix handling already closed sockets on shutdown
1 parent 2935c07 commit 920083b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

logstash_async/transport.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def _is_sock_write_buff_empty(self):
159159
return True
160160

161161
socket_fd = self._sock.fileno()
162+
if socket_fd == -1:
163+
return True
164+
162165
buffer_size = struct.pack('I', 0)
163166
ioctl_result = fcntl.ioctl(socket_fd, termios.TIOCOUTQ, buffer_size)
164167
buffer_size = struct.unpack('I', ioctl_result)[0]

0 commit comments

Comments
 (0)