go-zookeeper / zk

Native ZooKeeper client for Go
BSD 3-Clause "New" or "Revised" License
512 stars 130 forks source link

Fix deadlock caused by non-responsive ZK servers #80

Closed tobio closed 2 years ago

tobio commented 2 years ago

Fixes https://github.com/go-zookeeper/zk/issues/79

Instead of blindly waiting for a response from queueRequest, wait for a message on either the requests response channel or an indication that the client shouldQuit. This ensures that any ongoing requests are completed when a client is closed.

tobio commented 2 years ago

@pmazzini thanks for taking a look.

The latest push has fixed the test workflow in my fork, are you able to approve the checks against this PR?

codecov[bot] commented 2 years ago

Codecov Report

Merging #80 (5e66dae) into master (21b4929) will decrease coverage by 0.08%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #80      +/-   ##
==========================================
- Coverage   76.86%   76.78%   -0.09%     
==========================================
  Files           7        7              
  Lines        1193     1193              
==========================================
- Hits          917      916       -1     
- Misses        188      189       +1     
  Partials       88       88              
Impacted Files Coverage Δ
conn.go 74.37% <100.00%> (-0.16%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 21b4929...5e66dae. Read the comment docs.