[pve-devel] [PATCH http-server] anyevent: move unlink from http-server to endpoint

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jul 20 15:23:56 CEST 2021


On 20.07.21 13:51, Lorenz Stechauner wrote:
> any uploaded file has to be deleted by the corrosponding
> endpoint. the file upload was only used by the 'upload to
> storage' feature in pve.
> 
> this change allows the endpoint to delete the file itself,
> making the old and racey`sleep 1` (waiting until the worker
> has opened the file) obsolete.
> 

that was mostly from PVE 1.x times which used indeed an apache in front of the
API, bur if this is a breaking change it needs to be recorded as such with a
d/control `Breaks: libpve-storage-perl (<< x.y)`, else one can install a version
where PVE does not cleanup any uploaded temporary file.

As x.y is not yet known at time of sending this (there could be intermediate
bumps between this getting applied) it makes sense to not include that directly,
but it'd be definitively good to mention that the one applying this needs to do
record the Breaks.

> Signed-off-by: Lorenz Stechauner <l.stechauner at proxmox.com>
> ---
>  src/PVE/APIServer/AnyEvent.pm | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm
> index cd77806..8d498c5 100644
> --- a/src/PVE/APIServer/AnyEvent.pm
> +++ b/src/PVE/APIServer/AnyEvent.pm
> @@ -121,11 +121,7 @@ sub cleanup_reqstate {
>      delete $reqstate->{proto};
>      delete $reqstate->{accept_gzip};
>      delete $reqstate->{starttime};
> -
> -    if ($reqstate->{tmpfilename}) {
> -	unlink $reqstate->{tmpfilename};
> -	delete $reqstate->{tmpfilename};
> -    }
> +    delete $reqstate->{tmpfilename};
>  }
>  
>  sub client_do_disconnect {
> 






More information about the pve-devel mailing list