Univention Bugzilla – Bug 40166
The output of import hooks is not flushed promptly
Last modified: 2016-03-16 15:01:08 CET
During import via CLI tools the output of input hook scripts is not flushed promptly/in time. So the output of 10 import hook instances is written as coherent region to the logfile. This makes debugging faily time consuming if not impossible.
Analysing the customer output revealed that the output of the python process is buffered and only partially written to stdout/stderr. Then the hook scripts are called that print their output to stdout/stderr and flush stdout/stderr upon exit.
In the end the output looks like this:
(A=Output of the python process before calling the hook,
B=Output of the python process after calling the hook,
H=Output of the hook script)
To prevent this, a sys.stdout.flush(), sys.stderr.flush() has been inserted right before calling the hook script.
r67763 | Bug #40166: flush stdout and stderr before calling hook scripts
I could not reproduce this on CLI with create_ou but the code looks reasonable and doesn't break anything.
UCS@school 4.1 v5 has been released.
If this error occurs again, please clone this bug.