[pbs-devel] [PATCH proxmox-backup 5/9] file-restore-daemon: work around tokio DuplexStream bug

Fabian Grünbichler f.gruenbichler at proxmox.com
Fri May 7 09:26:51 CEST 2021


On May 6, 2021 8:12 pm, Thomas Lamprecht wrote:
> On 06.05.21 17:26, Stefan Reiter wrote:
>> See this PR for more info: https://github.com/tokio-rs/tokio/pull/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.
>> 
> 
> now that it got merged, do we want to cherry-pick this or await inclusion
> in stable instead of applying this workaround?
> 
> CC'ing Fabian as our tokio (or better said rust) packaging wizard

we can

A) use this workaround, and switch back once a fixed tokio version is 
available

B) cherry-pick the fix into our tokio package, not use this workaround, 
package and bump dependency ASAP once a tokio version with the fix is 
available

A has the advantage of not (subtly) breaking third-party builds that use 
crates from crates.io, but requires us to remember switching back once 
the fix is available. B has the advantage that we don't have to 
remember anything, since we'll update tokio sooner or later anyway ;)

both is fine for me, cherry-picking is about 10 minutes worth of work 
so..

> 
>> Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
>> ---
>> 
>> Thanks to @Wolfgang for helping debug this!
>> 
>>  src/bin/proxmox_restore_daemon/api.rs | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>> 
>> diff --git a/src/bin/proxmox_restore_daemon/api.rs b/src/bin/proxmox_restore_daemon/api.rs
>> index f1d601ce..5aeb69f3 100644
>> --- a/src/bin/proxmox_restore_daemon/api.rs
>> +++ b/src/bin/proxmox_restore_daemon/api.rs
>> @@ -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 {
>> 
> 
> 





More information about the pbs-devel mailing list