2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-02-14 09:39:51 +00:00

Close socket in relay_data

Closing the socket outside of relay_data causes relay_data
to stay alive, causing eventlet to think a filehandle is open that is not.

A reasonable question would be why eventlet fails to error that read
when the filehandle is closed, but for now, move the close activity
to the relay_data handler.

This resolves "Second simultaneous read on fileno" conditions introduced
by the fix for leaking filehandles.
This commit is contained in:
Jarrod Johnson 2021-08-26 11:52:22 -04:00
parent d0c23e490b
commit 7c617a160b

View File

@ -658,6 +658,7 @@ class ProxyConsole(object):
while data:
self.data_handler(data)
data = tlvdata.recv(self.remote)
self.remote.close()
def get_buffer_age(self):
# the server sends a buffer age if appropriate, no need to handle
@ -720,7 +721,6 @@ class ProxyConsole(object):
if self.remote:
try:
tlvdata.send(self.remote, {'operation': 'stop'})
self.remote.close()
except Exception:
pass
self.clisession = None