go-zookeeper icon indicating copy to clipboard operation
go-zookeeper copied to clipboard

Invalidate watchers when error in loop()

Open roylou opened this issue 9 years ago • 3 comments

In loop() function, when network error happens, sendLoop() and recvLoop() return for the next connection. loop() also flushes existing requests before reconnecting. Yet watchers should be also notified.

Without the patch watchers won't receive event. And if network error persists, the next connect() would never succeed and watchers will be waiting forever.

roylou avatar Jul 28 '15 15:07 roylou

Looks like some behaviors of error handling are changed because of my patch. I've updated unit test to reflect the patch. Please let me know if the patch looks good.

Another solution would be set a maximum retry in connect() function and error if can't reach clusters.

roylou avatar Jul 29 '15 02:07 roylou

+100

jiangjin avatar Aug 11 '15 15:08 jiangjin

Looks like there's a merge conflict here.

JensRantil avatar Oct 05 '17 11:10 JensRantil