Skip to content

Commit 4150b7e

Browse files
Merge pull request julien-duponchelle#124 from giacomolozito/master
Explicit close stream connection on exception
2 parents b92beb1 + 2a96d8f commit 4150b7e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pymysqlreplication/binlogstream.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ def fetchone(self):
244244
except pymysql.OperationalError as error:
245245
code, message = error.args
246246
if code in MYSQL_EXPECTED_ERROR_CODES:
247+
self._stream_connection.close()
247248
self.__connected_stream = False
248249
continue
249250

0 commit comments

Comments
 (0)