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

script_validator does not correctly handle return values #5799

Closed
Rytiss opened this issue Sep 9, 2024 · 3 comments · Fixed by #5803 or #5813
Closed

script_validator does not correctly handle return values #5799

Rytiss opened this issue Sep 9, 2024 · 3 comments · Fixed by #5803 or #5813

Comments

@Rytiss
Copy link
Contributor

Rytiss commented Sep 9, 2024

Describe the bug
Documentation at https://github.com/BOINC/boinc/wiki/Validators-in-C states that C++ validator can handle specific return values, such as:

ERR_OPENDIR if there was a transient error, e.g. the output file is on a network volume that is not available. The validator will try this result again later.

Same functionality does not seem to be available in the script_validator code. Returning -111 from the init_script results in the result being marked as invalid, and the workunit returns to unvalidated state and sends out a new result.

Steps To Reproduce

  1. create a basic validator script that returns an error value, e.g.
#!/usr/bin/php
exit(-111); // ERR_OPENDIR
  1. run the validator as an init script.

Expected behavior
Validation does not complete, result is not marked as valid, workunit is not marked as valid.

@AenBleidd
Copy link
Member

@davidpanderson, please take a look

@Rytiss
Copy link
Contributor Author

Rytiss commented Sep 10, 2024

Thanks David!

@Rytiss
Copy link
Contributor Author

Rytiss commented Sep 19, 2024

@davidpanderson I think invalid result state now got broken. My validator is now running in a loop on a result that should be marked as invalid (I exit(42), also tried other nonzero values too):

2024-09-19 09:42:29 [RES 3442067151 86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631] State not processed, 0
2024-09-19 09:42:29.8393 [CRITICAL]  init script ../bin/../tools/ce12_validator_init.php 3442067151 /data/processing/upload/26d/86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631_0 failed: 42
2024-09-19 09:42:29.8395 [CRITICAL]  check_set: init_result([RESULT#3442067151 86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631]) failed: Error -1
2024-09-19 09:42:29.8396 [CRITICAL]  [WU#989804062 86666478e484a2c2a8047f996e4edb18_8152965_34_single] check_set() error: Error -1
2024-09-19 09:42:30 [RES 3442067151 86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631] State not processed, 0
2024-09-19 09:42:30.0381 [CRITICAL]  init script ../bin/../tools/ce12_validator_init.php 3442067151 /data/processing/upload/26d/86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631_0 failed: 42
2024-09-19 09:42:30.0383 [CRITICAL]  check_set: init_result([RESULT#3442067151 86666478e484a2c2a8047f996e4edb18_8152965_34_1747243631]) failed: Error -1
2024-09-19 09:42:30.0384 [CRITICAL]  [WU#989804062 86666478e484a2c2a8047f996e4edb18_8152965_34_single] check_set() error: Error -1

exit(3) is handled correctly as a transient failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment