Skip to content

module-process: race condition in returning the process exit status #4272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
davidnich opened this issue Jun 30, 2021 · 4 comments
Open

module-process: race condition in returning the process exit status #4272

davidnich opened this issue Jun 30, 2021 · 4 comments

Comments

@davidnich
Copy link
Contributor

davidnich commented Jun 30, 2021

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)
@davidnich davidnich added this to the not planned milestone Jun 30, 2021
@davidnich davidnich self-assigned this Jun 30, 2021
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
…cess status with already-terminated processes; addressed exception-handling issues
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
…cess status with already-terminated processes; addressed exception-handling issues
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
…cess status with already-terminated processes; addressed exception-handling issues
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
…cess status with already-terminated processes; addressed exception-handling issues
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
davidnich added a commit to qorelanguage/module-process that referenced this issue Jul 6, 2021
@davidnich davidnich added the fixed label Jul 6, 2021
@davidnich davidnich modified the milestones: not planned, 0.9.16 Jul 6, 2021
@davidnich davidnich removed the fixed label Sep 10, 2021
@davidnich
Copy link
Contributor Author

still happening occasionally... root cause unknown

@davidnich davidnich reopened this Sep 10, 2021
davidnich added a commit to qorelanguage/module-process that referenced this issue Sep 10, 2021
…uage/qore#4303 updated to boost 1.71 (the last version that has a header-only filesystem library) to try to address weird and hard to reproduce process issues
davidnich added a commit to qorelanguage/module-process that referenced this issue Sep 10, 2021
@davidnich davidnich modified the milestones: 0.9.16, 1.0.5, 1.0.7 Sep 18, 2021
@davidnich davidnich modified the milestones: 1.0.7, 1.0.8, 1.0.9 Sep 26, 2021
@davidnich davidnich removed this from the 1.0.9 milestone Oct 7, 2021
@davidnich davidnich modified the milestones: 1.0.10, 1.0.11 Oct 7, 2021
@davidnich
Copy link
Contributor Author

likely to be a race condition in the boost process library handling SIGCHLD

@davidnich davidnich modified the milestones: 1.0.11, 1.0.12 Nov 24, 2021
davidnich added a commit to qorelanguage/module-process that referenced this issue Dec 27, 2021
…; the exit code is set from the async on_exit_handler() as well as after wait() if necessary
davidnich added a commit to qorelanguage/module-process that referenced this issue Dec 27, 2021
@davidnich
Copy link
Contributor Author

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

@davidnich
Copy link
Contributor Author

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'

@davidnich davidnich reopened this Jan 24, 2022
@davidnich davidnich added priority and removed fixed labels Feb 9, 2022
@davidnich davidnich modified the milestones: 1.0.12, backlog Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant