qore
qore copied to clipboard
module-process: race condition in returning the process exit status
sometimes a process's exit status is returned incorrectly as -1
instead of 0
ex - successful execution of a test with the process
module:
"
stderr : "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
"
exit_code : -1
The actual exit code was 0
also there can be false negatives:
resp: hash: (5 members)
status : "FINISHED"
exit_code : 0
stderr : "User exception: /opt/qorus/qlib/QorusObjectParser/QorusObjectParser.ql:48 (Qore): INVALID-NAME: invalid characters in name \"test_servi/ce\"; allowed name format: [A-Za-z0-9-_]*
validate_object_name() called at /opt/qorus/qlib/QorusObjectParser:324 (Qore user code)
TagParser::gotEnd() called at /opt/qorus/qlib/QorusObjectParser:231 (Qore user code)
TagParser::parse() called at /opt/qorus/qlib/QorusObjectParser/QorusObjectParserAPI.qc:112 (Qore user code)
Parser::parse() called at /opt/qorus/bin/oload:2055 (Qore user code)
oload::createServices() called at /opt/qorus/bin/oload:861 (Qore user code)
oload::constructor() called at <builtin>:-1 (Qore user code)
"
stdout : "\"/opt/qorus/user/tmp/qorusBug2541N5aoXhfmpXjKxV5/service_2541.qsd\": "
created : 2021-07-02 07:07:22.000000 Fri +02:00 (CEST)
still happening occasionally... root cause unknown
likely to be a race condition in the boost process library handling SIGCHLD
hopefully finally fixed:
-
ECHILD
on wait ignored - the async
on_exit_handler()
sets the process's exit code if available - lifetime of the async handler now = internal process object's
this is still happening - rarely. but it still happens
"
stderr : "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
"
exit_code : -1
FAILURE: mainTest: 3 assertions, 2 succeeded
Assertion failure at /builds/qorus/qorus/test/QorusBug3233ConfigItems.qtest:59 [Main::mainTest()] <- /builds/qorus/qorus/test/QorusBug3233ConfigItems.qtest:37 [Main::constructor()]
-----
>> Expected: 0, Actual: -1, Difference: 1
-----
Ran 1 test case, 1 error (3 assertions, 2 succeeded)
+ RESULTS=' 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1'