#886: SimFactory does not correctly detect a failed submit command
| Reporter: | Ian Hinder |
| Status: | resolved |
| Milestone: | |
| Version: | |
| Type: | bug |
| Priority: | minor |
| Component: | SimFactory |
Changes (by Roland Haas):
| status: | resolved (was new) |
If qsub can't be found, simfactory doesn't notice that the command returned a nonzero exit code, and proceeds to return 0 itself. The submit command is in simrestart.py:
output = simlib.ExecuteCommand(submitCommand, output=True)
This should check that the exit code is zero, or fail noisily. What it actually does is
fd = os.popen(command)
output = fd.read()
fd.close()
return output
Apart from the weird reuse of the output input argument as a return value for something else, it is not checking the exit code in the case where the output was requested.
Keyword:
Comment (by Roland Haas):
Simfactory checks for error in (all) ExecuteCommand calls since git hash a38ff13 "check errors when calling ExecuteCommand(...,output=True)" of simfactory2 from Fri Jul 10 11:32:55 2015 +0200. This includes the call in submit, which forces the jobid to be "-1" in this case and reports an error to the user (but does not return a non-zero exit code to the shell).
--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/886/simfactory-does-not-correctly-detect-a