[pdm-devel] [PATCH datacenter-manager/yew-widget-toolkit 0/7] avoid more race conditions on log in

Shannon Sterz s.sterz at proxmox.com
Thu Nov 27 16:36:02 CET 2025


previously [1] a commit addressed an issue that could log out users
right after they logged in again. this series tries to address several
more races that could have the same effect. to achieve that all requests
need to be aborted once a log out occurs. this should reduce the
possibility that one of these requests ends up in a race with a log in
request. if one of the requests addressed in this series runs with an
invalid ticket in parallel to a login request and finishes after the
login, the user will be kicked out again right after logging in.

hence, all occurrences of `Scope::send_future()` are replaced with
either AsyncAbortGuard or AsyncPool. AsyncAbortGuard is chosen when it's
about a one of requests, whereas AsyncPool is more useful in cases where
several (potentially parallel) requests may occur. these will abort any
requests when they are dropped. so once the login panel is rendered an
all other components are destroyed, the requests will be aborted.

we also need to refactor the DatacenterManagerApp a little bit. it
always gets rendered. so any requests it makes won't be dropped on log
out as it always gets rendered. hence, manually abort all its request
by:

- aborting the Loader for running tasks
- dropping its AsyncPool
- not rendering the AclContext when logged out

[1]: https://git.proxmox.com/?p=proxmox-datacenter-manager.git;a=commit;h=6a14f4571b0a8cf67949a13391671bba7c91c95b

proxmox-yew-widget-toolkit:

Shannon Sterz (1):
  loader: add helper to allow aborting a load

 src/state/loader.rs | 5 +++++
 1 file changed, 5 insertions(+)


proxmox-datacenter-manager:

Shannon Sterz (6):
  ui: main: abort running task load on log out
  ui: main: move requests into an async pool and drop it on logout
  ui: main: only render acl context when we are logged in
  ui: resource tree: use an async pool for requests
  ui: node status: handle the request via an AsyncAbortGuard
  ui: top nav bar: use an abort guard for loading the version

 ui/src/administration/node_status.rs | 20 ++++++++++----
 ui/src/main.rs                       | 41 +++++++++++++++++++---------
 ui/src/top_nav_bar.rs                |  9 ++++--
 ui/src/widget/resource_tree.rs       |  6 +++-
 4 files changed, 54 insertions(+), 22 deletions(-)


Summary over all repositories:
  5 files changed, 59 insertions(+), 22 deletions(-)

--
Generated by git-murpp 0.8.1




More information about the pdm-devel mailing list