charlesdong1991 commented on code in PR #399:
URL: https://github.com/apache/fluss-rust/pull/399#discussion_r2868755221
##########
crates/fluss/src/rpc/server_connection.rs:
##########
@@ -388,10 +404,28 @@ where
self.send_message(buf).await?;
_cleanup_on_cancel.message_sent();
- let mut response = rx.await.map_err(|e| Error::UnexpectedError {
- message: "Got recvError, some one close the channel".to_string(),
- source: Some(Box::new(e)),
- })??;
+ let mut response = match self.request_timeout {
+ Some(timeout) => match tokio::time::timeout(timeout, rx).await {
+ Ok(result) => result.map_err(|e| Error::UnexpectedError {
+ message: "Got recvError, some one close the
channel".to_string(),
+ source: Some(Box::new(e)),
+ })??,
+ Err(_elapsed) => {
+ if let ConnectionState::RequestMap(map) =
self.state.lock().deref_mut() {
+ map.remove(&request_id);
+ }
+ return Err(RpcError::RequestTimeout {
+ timeout,
+ api_key: R::API_KEY,
+ }
+ .into());
Review Comment:
good call, need to check
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]