[pbs-devel] [PATCH v3 proxmox-backup 4/5] client: reader: add finish method to signal client state to server
Christian Ebner
c.ebner at proxmox.com
Thu Jan 9 15:06:22 CET 2025
Signal the server that the client has finished its operation and is
about to close the connection. This allows the server side to react
accordingly.
Termination of the reader connection after successuful completion is
now no longer logged as connection error, which has caused confusion
[0].
Report in the community forum:
[0] https://forum.proxmox.com/threads/158306/
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 2:
- instead of implicitly calling the `finish` endpoint on drop,
require an explicit method call.
pbs-client/src/backup_reader.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pbs-client/src/backup_reader.rs b/pbs-client/src/backup_reader.rs
index 18442ebca..3474c8ce3 100644
--- a/pbs-client/src/backup_reader.rs
+++ b/pbs-client/src/backup_reader.rs
@@ -77,6 +77,12 @@ impl BackupReader {
Ok(BackupReader::new(h2, abort, crypt_config))
}
+ /// Terminate reader session by signaling server via `finish` api call before closing connection
+ pub async fn finish(self: Arc<Self>) -> Result<(), Error> {
+ let _value = self.post("finish", None).await?;
+ Ok(())
+ }
+
/// Execute a GET request
pub async fn get(&self, path: &str, param: Option<Value>) -> Result<Value, Error> {
self.h2.get(path, param).await
--
2.39.5
More information about the pbs-devel
mailing list