]> git.proxmox.com Git - pve-common.git/commitdiff
fork_worker: use separate pipe for status messages
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 15 Dec 2017 16:00:30 +0000 (17:00 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 18 Dec 2017 12:37:05 +0000 (13:37 +0100)
We forced line wise flushing of the workers STDOUT and STDERR to
capture the final status (TASK OK/TASK ERROR).
Thus, if the code executed in the worker wanted to flush explicitly,
e.g., when the last output wasn't new line terminated but needed to
reach the users eyes, the parent just ignored that.
This leads to confusing results in CLI handlers using fork_workers.

So remove the buffering logic completely and introduce a separate
pipe for sending the final status.
Said pipe gets once read after the child closes (EOF) its STDOUT.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>

No differences found