Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
file-restore-daemon: work around tokio DuplexStream bug
Browse files Browse the repository at this point in the history
See this PR for more info: tokio-rs/tokio#3756

As a workaround use a pair of connected unix sockets - this obviously
incurs some overhead, albeit not measureable on my machine. Once tokio
includes the fix we can go back to a DuplexStream for performance and
simplicity.

Signed-off-by: Stefan Reiter <[email protected]>
  • Loading branch information
PiMaker authored and ThomasLamprecht committed May 25, 2021
1 parent e9c2638 commit 75f9f40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/proxmox_restore_daemon/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,11 @@ fn extract(
bail!("file or directory {:?} does not exist", path);
}

let (mut writer, reader) = tokio::io::duplex(1024 * 64);
// FIXME: DuplexStream is currently broken and doesn't wake pending writers on close, i.e.
// this doesn't drop the WatchdogInhibitor if we encounter an error (client aborts, etc...)
// see: https://github.com/tokio-rs/tokio/pull/3756
// let (mut writer, reader) = tokio::io::duplex(1024 * 64);
let (mut writer, reader) = tokio::net::UnixStream::pair()?;

if pxar {
tokio::spawn(async move {
Expand Down

0 comments on commit 75f9f40

Please sign in to comment.