Skip to content

Commit ea5972a

Browse files
authored
Merge pull request containerd#75 from lifupan/fix_send
server: fix the issue of failed to trigger client handler
2 parents 5185359 + 6a97317 commit ea5972a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ttrpc"
3-
version = "0.4.12"
3+
version = "0.4.13"
44
authors = ["The AntFin Kata Team <kata@list.alibaba-inc.com>"]
55
edition = "2018"
66
license = "Apache-2.0"

src/sync/server.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fn start_method_handler_thread(
110110
if quit.load(Ordering::SeqCst) {
111111
// notify the connection dealing main thread to stop.
112112
control_tx
113-
.try_send(())
113+
.send(())
114114
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
115115
break;
116116
}
@@ -120,15 +120,16 @@ fn start_method_handler_thread(
120120
if quit.load(Ordering::SeqCst) {
121121
// notify the connection dealing main thread to stop.
122122
control_tx
123-
.try_send(())
123+
.send(())
124124
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
125125
break;
126126
}
127127

128128
let c = wtc.fetch_sub(1, Ordering::SeqCst) - 1;
129129
if c < min {
130+
trace!("notify client handler to create much more worker threads!");
130131
control_tx
131-
.try_send(())
132+
.send(())
132133
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
133134
}
134135

@@ -147,7 +148,7 @@ fn start_method_handler_thread(
147148
// the connection dealing main thread would
148149
// have exited.
149150
control_tx
150-
.try_send(())
151+
.send(())
151152
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
152153
break;
153154
}
@@ -174,7 +175,7 @@ fn start_method_handler_thread(
174175
// the connection dealing main thread would have
175176
// exited.
176177
control_tx
177-
.try_send(())
178+
.send(())
178179
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
179180
break;
180181
}
@@ -197,7 +198,7 @@ fn start_method_handler_thread(
197198
// the connection dealing main thread would have
198199
// exited.
199200
control_tx
200-
.try_send(())
201+
.send(())
201202
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
202203
break;
203204
}
@@ -215,7 +216,7 @@ fn start_method_handler_thread(
215216
// the connection dealing main thread would have
216217
// exited.
217218
control_tx
218-
.try_send(())
219+
.send(())
219220
.unwrap_or_else(|err| debug!("Failed to try send {:?}", err));
220221
break;
221222
}

0 commit comments

Comments
 (0)