Skip to content

Commit 2a96d8f

Browse files
committed
Explicit close stream connection on exception, to prevent sockets from sitting in CLOSE_WAIT status with PyPy
1 parent 7259ef4 commit 2a96d8f

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)