[pbs-devel] [PATCH backup 5/7] proxy: implement 'reload-certificate' command

Wolfgang Bumiller w.bumiller at proxmox.com
Wed May 12 11:01:54 CEST 2021


> On 05/12/2021 10:37 AM Dietmar Maurer <dietmar at proxmox.com> wrote:
> 
>  
> > I wish there was some nice form of a `select_loop!`-like helper...
> 
> Another way would be to avoid the select inside the loop, for example
> by using an Atomic counter (cert is loaded on next accept, not immediately)

That would also work. Should the reload command handler also log then, so it is visible that there's a pending reload?

Another possibility is wrapping the Arc<SslAcceptor> in an AtomicBox (though that's not in the std lib, only AtomicPtr, but it should be easy to write one, (and there's an atomic_box crate)).
The advantage there being that the command handler could do the certificate loading and provide feedback to its client about whether it was successful, and it can just replace the pointer atomically.





More information about the pbs-devel mailing list