Skip to content

Commit 7f697d8

Browse files
committed
Bugfix: fix client request hang, for socket error.
If client socket get error, all the client request without timeout will hang for client receiver thread do not return the error. Signed-off-by: quanweiZhou <[email protected]> Signed-off-by: quanweiZhou <[email protected]>
1 parent ec2a919 commit 7f697d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/sync/client.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ impl Client {
117117
Err(x) => match x {
118118
Error::Socket(y) => {
119119
trace!("Socket error {}", y);
120+
let mut map = recver_map_orig.lock().unwrap();
121+
for (_, recver_tx) in map.iter_mut() {
122+
recver_tx
123+
.send(Err(Error::Others(format!("socket error {}", y))))
124+
.unwrap_or_else(|e| {
125+
error!("The request has returned error {:?}", e)
126+
});
127+
}
128+
map.clear();
120129
break;
121130
}
122131
_ => {

0 commit comments

Comments
 (0)