[pbs-devel] [PATCH pxar] encoder: flush after writing last entry

Dietmar Maurer dietmar at proxmox.com
Tue Mar 30 09:10:50 CEST 2021


> After an off-list talk with Dominik we concluded that keeping it for `Owned`
> writers is the safer approach for the simple reason that in *async* code (eg.
> tokio's async BufWriter equivalent) you *do* need to flush buffered writers.
> 
> This is probably because there's no `AsyncDrop` and there's no guarantee that
> the future's `Drop` handler is called in a place where it is safe to call
> tokio's `block_in_place` (after all it panics when it is outside a tokio RT
> thread, *including* being inside a `runtime.block_on()` called from outside
> a tokio RT thread).
> 
> So yeah, let's not revert this, but limit it to `EncoderOutput::Owned`.

But Flushing at every sub-dir makes no real sense. You only need
to flush once when you are finished writing the pxar (for the top level dir)?





More information about the pbs-devel mailing list