public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox v2 0/4] worker task setup improvements
@ 2024-12-02 13:04 Fabian Grünbichler
  2024-12-02 13:04 ` [pbs-devel] [PATCH proxmox v2 1/4] rest-server: handle failure in worker task setup correctly Fabian Grünbichler
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Fabian Grünbichler @ 2024-12-02 13:04 UTC (permalink / raw)
  To: pbs-devel

This series fixes two issues related to reset server shutdown/reload and
worker task accounting.

issue 1 (patches 1, rfcs 3, 4):

if WorkerTask::new returned an error because updating the task indices
failed (for example, because the lock covering such updates was not
acquired because of a timeout), the task was registered in the worker
task list, but not returned to the caller, which means the task could
never actually execute and reach its cleanup/log_result stage, which
would unregister it again. effectively, in such a scenario the worker
task is "leaked", but the task count decrement never happens, which in
turn means the corresponding proxy can never shutdown, since it will
wait for the phantom task to finish forever.

this issue was actually found in the wild on a system with lots of
activity.

issue 2 (patch 2):

a lock scope issue could cause a temporary inconsistency between the
task list and task count, if multiple tasks log their result in
parallel. the discrepancy disappars with the next task that is created
or logs its result, since the count is always reset to the current count
and not incremented/decremented.

this issue was found while analyzing the code.

Fabian Grünbichler (4):
  rest-server: handle failure in worker task setup correctly
  rest-server: close race window when updating worker task count
  rest-server: make worker task creation error handling more idiomatic
  rest-server: increase task index lock timeout to 15s

 proxmox-rest-server/src/worker_task.rs | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

-- 
2.39.5



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-12-02 15:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-02 13:04 [pbs-devel] [PATCH proxmox v2 0/4] worker task setup improvements Fabian Grünbichler
2024-12-02 13:04 ` [pbs-devel] [PATCH proxmox v2 1/4] rest-server: handle failure in worker task setup correctly Fabian Grünbichler
2024-12-02 15:57   ` [pbs-devel] applied: " Thomas Lamprecht
2024-12-02 13:04 ` [pbs-devel] [PATCH proxmox v2 2/4] rest-server: close race window when updating worker task count Fabian Grünbichler
2024-12-02 15:57   ` [pbs-devel] applied: " Thomas Lamprecht
2024-12-02 13:04 ` [pbs-devel] [RFC proxmox v2 3/4] rest-server: make worker task creation error handling more idiomatic Fabian Grünbichler
2024-12-02 15:58   ` Thomas Lamprecht
2024-12-02 13:04 ` [pbs-devel] [RFC proxmox v2 4/4] rest-server: increase task index lock timeout to 15s Fabian Grünbichler
2024-12-02 15:59   ` [pbs-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal