-
Notifications
You must be signed in to change notification settings - Fork 690
Open
Description
Description
When I run a script that monitors binlog changes for a long time, the stream object may not be able to pull the relevant events until I restart the script.
Here is some of my code:
log_pos, log_file = "mysql-bin.000004", 928361
stream = BinLogStreamReader(
connection_settings=connection_settings,
server_id=server_id,
only_events=[WriteRowsEvent, UpdateRowsEvent, DeleteRowsEvent],
only_schemas=["dbname"],
only_tables=['table1', 'table2'],
blocking=True,
resume_stream=True,
log_pos=log_pos,
log_file=log_file
)
# start to listen
for event in stream:
...When the script first runs, it can listen to all log information.
However, after running for a while, for example, 30 minutes or an hour, this listener will stop working(But it won't report an error). In other words, when the data in the relevant table changes, the for loop will not respond. It only works again after I restart the script.
Related Information
- Platform: Ubuntu Or Windows 11
- MySQL Version: 5.7
- Python Version: 3.11
- python-mysql-replication Version: 0.46
Metadata
Metadata
Assignees
Labels
No labels