moiot / gravity

A Data Replication Center
Apache License 2.0
912 stars 173 forks source link

fix position cache deadlock #319

Closed Ryan-Git closed 3 years ago

Ryan-Git commented 3 years ago

position cache has a lock and position itself has a lock. during normal position update, the sequence is position -> cache but when flush, it's opposite, which may cause deadlock

this pr releases cache lock before encode position to prevent such case, closes #309