Skip to content
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

Process::SubProcess::Group::Wait() Method fails with Timeout #20

Open
domibay-hugo opened this issue Feb 4, 2021 · 3 comments
Open

Comments

@domibay-hugo
Copy link
Contributor

The Method Process::SubProcess::Group::Wait() fails with Timeout Error when the child processes in Process::SubProcess::Group were not launched with the Method Process::SubProcess::Group::Launch()

@domibay-hugo
Copy link
Contributor Author

I wrote a Test Sequence in test_group.t to demonstrate this behaviour:

$ ./test_group.t
[...]
Test: 'Process::SubProcess::Group::Wait() Method' do ...
ok 46 - Profiling activated
ok 47 - Profiling activated
ok 48 - Profiling activated
ok 49 - scripts (count: '3'): added correctly
ok 50 - Check Interval activated
ok 51 - Execution Timeout activated
Process Group Execution Start - Time Now: '1612452392.11664' s
ok 52 - Process No. '0': Listed correctly
ok 53 - Process No. '0': Launch succeeded
ok 54 - Process No. '1': Listed correctly
ok 55 - Process No. '1': Launch succeeded
ok 56 - Process No. '2': Listed correctly
ok 57 - Process No. '2': Launch succeeded
ok 58 - Process Group Execution: All Processes are launched
ok 59 - Process Group Execution: Execution failed as expected
Process Group Execution End - Time Now: '1612452394.1369' s
Process Group Execution finished in '2020.26510238647' ms
Process Group ERROR CODE: '4'
ok 60 - Process Group Execution: ERROR CODE is correct
Process Group STDOUT: ''
Process Group STDERR: 'Sub Processes 'Count: 1': Execution timed out!
Execution Time '1612452395 / 7'
Processes will be terminated.
Sub Processes: Processes terminating ...
'
ok 61 - Process No. '0': Listed correctly
Process (27761) 'test-script:3s' finished with [4]:
ERROR CODE: '4'
EXIT CODE: '-1'
ok 62 - Execution Time not measured as expected
Read Timeout: '2'
Execution Time: '-1'
STDOUT: ''
STDERR: 'script 'test_script.pl' START 0 ERROR
Sub Process (27761) 'test-script:3s': Process terminating ...
'
ok 63 - Process No. '1': Listed correctly
Process (27762) 'test-script:5s' finished with [4]:
ERROR CODE: '4'
EXIT CODE: '-1'
ok 64 - Execution Time not measured as expected
Read Timeout: '2'
Execution Time: '-1'
STDOUT: ''
STDERR: 'Sub Process (27762) 'test-script:5s': Process terminating ...
script 'test_script.pl' START 0 ERROR
'
ok 65 - Process No. '2': Listed correctly
Process (27763) 'test-script:13s' finished with [4]:
ERROR CODE: '4'
EXIT CODE: '-1'
ok 66 - Execution Time not measured as expected
Read Timeout: '2'
Execution Time: '-1'
STDOUT: ''
STDERR: 'Sub Process (27763) 'test-script:13s': Process terminating ...
script 'test_script.pl' START 0 ERROR
'
not ok 67 - '1' Process timed out as expected
#   Failed test ''1' Process timed out as expected'
#   at ./test_group.t line 641.
#          got: '3'
#     expected: '1'
Process Group Execution Timeout - Count: '3'

1..67
# Looks like you failed 1 test of 67.

When the child processes are launched seperately the Method Process::SubProcess::Group::Wait() is unable to recognize the start time and finishes all processes as timed out

@bodo-hugo-barwich
Copy link
Owner

The test in the Pull Request documents that the issue is mitigated.
But I think there are still more implication for the demonstrated Use Case

@bodo-hugo-barwich
Copy link
Owner

For better synchronisation the Process::SubProcess must expose its Start Time which than can be used to re-synchronise the Process::SubProcess::Group Start Time this should then make the Process::SubProcess::Group::Wait() method more reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants