dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

fix: reduce delay when stop replica #3020

Open BorysTheDev opened this issue 1 year ago • 1 comments

this should fix the problem: Running replicaof no one on replica in full sync state returns after more than 20 seconds the problem was that after we shutdown the socket the buffer still contained data and we processed it.

BorysTheDev avatar May 08 '24 12:05 BorysTheDev

Actually it might be that we need just to switch those two lines 🤔

https://github.com/dragonflydb/dragonfly/blob/3dd6c4959c3056d6f007cc4001e0923302a566a2/src/server/replica.cc#L144-L145

With this order, the loop continues working and blocks because ENABLE is still set

With an inverse order we should be cautious that nothing overrides it before cancel started

dranikpg avatar May 08 '24 13:05 dranikpg