Jens-G commented on code in PR #3399:
URL: https://github.com/apache/thrift/pull/3399#discussion_r3107500022
##########
lib/rs/src/transport/socket.rs:
##########
@@ -82,9 +89,42 @@ impl TTcpChannel {
pub fn with_stream(stream: TcpStream) -> TTcpChannel {
TTcpChannel {
stream: Some(stream),
+ read_timeout: None,
+ write_timeout: None,
}
}
+ /// Set the read timeout for this channel.
+ pub fn set_read_timeout(&mut self, timeout: Option<Duration>) ->
crate::Result<()> {
+ if let Some(ref stream) = self.stream {
+ stream.set_read_timeout(timeout)?;
+ }
+
+ self.read_timeout = timeout;
+ Ok(())
+ }
+
+ /// Set the write timeout for this channel.
+ pub fn set_write_timeout(&mut self, timeout: Option<Duration>) ->
crate::Result<()> {
+ if let Some(ref stream) = self.stream {
+ stream.set_write_timeout(timeout)?;
+ }
+
+ self.write_timeout = timeout;
+ Ok(())
+ }
+
+ /// Set the read and write timeouts for this channel.
+ pub fn set_timeouts(
+ &mut self,
Review Comment:
Should we also have getters to make it complete?
##########
lib/rs/test/Cargo.toml:
##########
@@ -10,8 +10,7 @@ publish = false
clap = "~2.33"
bitflags = "=1.2"
log = "0.4"
-uuid = "1"
+uuid = ">=1, <1.21"
Review Comment:
Why do we want to do that? If there is an incompatibility with >= 1.21, the
proper approach would be to fix the incompatibility.
-1 I'm against it. Even more as the change is not explained at all.
##########
lib/rs/src/transport/socket.rs:
##########
@@ -82,9 +89,42 @@ impl TTcpChannel {
pub fn with_stream(stream: TcpStream) -> TTcpChannel {
TTcpChannel {
stream: Some(stream),
+ read_timeout: None,
+ write_timeout: None,
}
Review Comment:
The incoming stream may have timeouts configured. This gives an inconsistent
state.
--
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]