diff --git a/sched/script_validator.cpp b/sched/script_validator.cpp index 122ce54fbf..6a34efce98 100644 --- a/sched/script_validator.cpp +++ b/sched/script_validator.cpp @@ -104,7 +104,11 @@ void validate_handler_usage() { ); } -// see validate_util2.h for return values +// run script to check a result +// if script exits with VAL_RESULT_TRANSIENT_ERROR, return that; +// the WU will be validated again after a delay. +// +// any other nonzero return means the result is not valid // int init_result(RESULT& result, void*&) { if (init_script.empty()) { @@ -144,10 +148,13 @@ int init_result(RESULT& result, void*&) { int s = WEXITSTATUS(retval); if (!s) return 0; if (s == VAL_RESULT_TRANSIENT_ERROR) { + log_messages.printf(MSG_NORMAL, + "init script return transient error" + ); return VAL_RESULT_TRANSIENT_ERROR; } - log_messages.printf(MSG_CRITICAL, - "init script %s failed: %d\n", cmd, s + log_messages.printf(MSG_NORMAL, + "init script %s returned: %d\n", cmd, s ); return -1; } diff --git a/sched/validate_util2.cpp b/sched/validate_util2.cpp index 04ba5aa574..bccd9010a3 100644 --- a/sched/validate_util2.cpp +++ b/sched/validate_util2.cpp @@ -59,6 +59,8 @@ using std::vector; // (i.e. there was a broken NFS mount). // Should call this again after a while. // +// always return zero +// int check_set( vector& results, WORKUNIT& wu, DB_ID_TYPE& canonicalid, double&, bool& retry @@ -74,6 +76,9 @@ int check_set( had_error.resize(n); // Initialize results + // For each one we potentially allocate data, + // so always exit via goto cleanup: + // to free this mem for (i=0; i matches; matches.resize(n); neq = 0; - for (j=0; j!=n; j++) { + for (j=0; j= min_valid) { @@ -185,12 +189,11 @@ int check_set( } } - retval = 0; cleanup: for (i=0; i