containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

server: fix the issue of failed to trigger client handler #75

Closed lifupan closed 3 years ago

lifupan commented 3 years ago

Since the sync channel with a buffer size of 0 will become "rendezvous channel" where a try_send would return directly with an error when its peer receiver isn't waiting to acquire some data, and in this case there would be chance to miss trigger client handler to create much more worker threads to handle the request messages.

Thus, it should use "send" to block until its peer receiver is available to hand off the message.

Signed-off-by: fupan.lfp fupan.lfp@antfin.com