Skip to content

Commit

Permalink
Merge pull request #24 from robsdedude/fix/recv-timeout-hint-only-for…
Browse files Browse the repository at this point in the history
…-read

Fix `connection.recv_timeout_seconds` only for reads
  • Loading branch information
robsdedude authored Jan 29, 2025
2 parents d6ecc61 + 05bd530 commit 0eb4d91
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
23 changes: 13 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,43 @@

## NEXT
***
**⭐ New Features**
**⭐️ New Features**
- Add support for Bolt 5.6 (GQL compatible notifications/result statuses)
- ⚠️ `neo4j::driver::notification::NotificationFilter`'s API has been completely reworked to support this new feature and enable more internal changes in the future without breaking the API again.
- ⚠️ changed `neo4j::summary::Summary::notifications` from `Option<Vec<Notification>>` to `Vec<Notification>` defaulting to `Vec::new()` when the server does not send any notifications.

**🔧 Fixes**
- Rework `neo4j::value::graph::Path`
- `Path`s now properly validate data received from the server (as documented)
- ⚠️ The return type of `Path::traverse()` was changed to reflect that paths with only one node and no relationships exist.
- The invariants of `Path` were changed for the above reason, too.
- New methods `Path::new()`, `Path::new_unchecked()`, and `Path::verify_invariants()`.
- Add support for Bolt 5.6 (GQL compatible notifications/result statuses)
- ⚠️ `neo4j::driver::notification::NotificationFilter`'s API has been completely reworked to support this new feature and enable more internal changes in the future without breaking the API again.
- ⚠️ changed `neo4j::summary::Summary::notifications` from `Option<Vec<Notification>>` to `Vec<Notification>` defaulting to `Vec::new()` when the server does not send any notifications.
- Fix connection hint `connection.recv_timeout_seconds` should only be applied to reads, not writes.


## 0.1.0
***
**⭐ New Features**
** New Features**
- Add support for Bolt 5.2, which adds notification filtering.
- Add support for Bolt 5.3 (bolt agent).
- Add support for Bolt 5.4 (telemetry).
- Add `Driver::is_encrypted()`.
- Introduce `neo4j::driver::Conifg::with_keep_alive()` and `without_keep_alive()`.

**👏 Improvements**
**👏 Improvements**
- ⚠️ ️️Bump `chrono-tz` from `0.8` to `0.9` (types of this crate are exposed through the driver's API).
- ⚠️ ️️Bump `rustls` from `0.22` to `0.23`:
- types of this crate are exposed through the driver's API
- other breaking changes (e.g., new build requirements).
See [rustls' changelog](https://github.com/rustls/rustls/releases/tag/v%2F0.23.0) for more details.

**🔧 Fixes**
**🔧 Fixes**
- 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**
**🧹Clean-up**
- ⚠️ Remove useless lifetime parameter from `SessionConfig::with_database()`.
- ⚠️ Change return type of `ConnectionConfig::with_encryption_trust_any_certificate() ` from `Result<Self, Error>` to `Self`.
- ⚠️ Reduce the number of lifetime generic parameters in `TransactionQueryBuilder` and `TransactionRecordStream`.
Expand All @@ -49,7 +52,7 @@
**👏 Improvements**
- Impl `FromStr` for `neo4j::driver::ConnectionConfig` (besides `TryFrom<&str>`).

**🧹Clean-up**
**🧹Clean-up**
- ⚠️ Update dependencies.
Among others `rustls`.
To accommodate this change, the `rustls_dangerous_configuration` feature was removed.
Expand All @@ -65,7 +68,7 @@
Same for `TransactionBuilder`.
- ⚠️ Move `neo4j::Address` to `neo4j::address::Address`

**📚 Docs**
**📚 Docs**
- Much more documentation.


Expand Down
18 changes: 5 additions & 13 deletions neo4j/src/driver/io/bolt/bolt5x0/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use std::borrow::Borrow;
use std::collections::HashMap;
use std::fmt::Debug;
use std::io::{Error as IoError, Read, Write};
use std::io::{Read, Write};
use std::mem;
use std::net::TcpStream;
use std::ops::Deref;
Expand Down Expand Up @@ -278,27 +278,19 @@ impl<T: BoltStructTranslator> Bolt5x0<T> {
socket
.map(|socket| {
let timeout = Some(Duration::from_secs(*timeout as u64));
socket.set_read_timeout(timeout)?;
socket.set_write_timeout(timeout)?;
Ok(())
socket.set_read_timeout(timeout)
})
.transpose()
.unwrap_or_else(|err: IoError| {
.unwrap_or_else(|err| {
warn!("Failed to set socket timeout as hinted by the server: {err}");
None
});
}
ValueReceive::Integer(_) => {
warn!(
"Server sent unexpected {RECV_TIMEOUT_KEY} value {:?}",
timeout
);
warn!("Server sent unexpected {RECV_TIMEOUT_KEY} value {timeout:?}");
}
_ => {
warn!(
"Server sent unexpected {RECV_TIMEOUT_KEY} type {:?}",
timeout
);
warn!("Server sent unexpected {RECV_TIMEOUT_KEY} type {timeout:?}");
}
}
}
Expand Down

0 comments on commit 0eb4d91

Please # to comment.