diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d3a3a7..833a38b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Fix `Transaction::rolblack()` failing if a result stream failed before. - Fix errors during transaction `BEGIN` not being properly propagated. - Fix propagation of `is_retryable()` of errors within transactions. +- Fix connection hint `connection.recv_timeout_seconds` not always being respected leading to connections timeing out too late. **🧹Clean-up** - ⚠️ Removed useless lifetime parameter from `SessionConfig::with_database()`. diff --git a/neo4j/src/driver/io/deadline.rs b/neo4j/src/driver/io/deadline.rs index a95292c..89cc03b 100644 --- a/neo4j/src/driver/io/deadline.rs +++ b/neo4j/src/driver/io/deadline.rs @@ -121,6 +121,12 @@ impl<'tcp, S: Read + Write> DeadlineIO<'tcp, S> { // deadline in the future Some(timeout) => timeout, }; + if let Some(old_timeout) = old_timeout { + if timeout >= old_timeout { + let res = work(self); + return self.wrap_io_error(res, ReaderErrorDuring::IO); + } + } self.wrap_io_error( set_socket_timeout(socket, Some(timeout)), ReaderErrorDuring::SetTimeout,