Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
close properly tcp connection on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dmachard committed Feb 3, 2021
1 parent 3c542e6 commit 74fba91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dnstap_receiver/inputs/input_tcpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ async def tcp_client(cfg, cfg_input, queues_list, stats, geoip_reader, cache):
except asyncio.CancelledError:
clogger.debug(f'Input handler: {peername} - closing connection.')
writer.close()
await writer.wait_closed()
except asyncio.IncompleteReadError:
clogger.debug(f'Input handler: {peername} - disconnected')
finally:
writer.close()
clogger.debug(f'Input handler: {peername} - closed')

async def start_tcpclient(cfg, queues_list, stats, geoip_reader, cache):
Expand Down

0 comments on commit 74fba91

Please sign in to comment.