Skip to content

Commit

Permalink
Fix socket deadline never overwriting connection hint timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
robsdedude committed Apr 13, 2024
1 parent e3061f9 commit 35d5391
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()`.
Expand Down
6 changes: 6 additions & 0 deletions neo4j/src/driver/io/deadline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 35d5391

Please sign in to comment.