]> git.proxmox.com Git - pve-common.git/commit
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)
commited52a8435a6dcdf77568280679355eba6c5857b6
treef1ec368115f730d0f690684b7a9c98d5bd66ad9a
parent95109cc44eb72e0b1b1a66b800a3f3cb99980eea
fork_worker: use separate pipe for status messages

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>
src/PVE/RESTEnvironment.pm