buda-base / drs-deposit

Harvard DRS Deposit base
1 stars 0 forks source link

Fix logging of failed builds #70

Closed jskNorthgate closed 3 years ago

jskNorthgate commented 5 years ago

make-drs-batch.sh calls Python updateBuildStatus after building a batch. There are cases where the batch fails, but the build directory is intact, so the phrase

if [ ! -f ${targetProjectsRoot}/${batchName}/batch.xml ] ; then ... updateBuildStatus ${DbConnectionString} "${targetProjectsRoot}/${batchName}" "FAIL" 2>&1 | tee -a ${logPath} else works, because "${targetProjectsRoot}/${batchName}" exists, and has subdirectories which are volume names, which updateBuildStatus uses to update each Volume record in the database. There are cases where the batch fails and there is no directory.

Expected Outcome The volumes in the batch are logged as having failed
Actual Outcome The calls to updateBuildStatus fail, and the volumes aren't having logged as failed. There's no penalty for this, they are still marked Queued, so won't be downloaded again.
jimk-bdrc commented 5 years ago

Actually, there is a penalty, if we ever want to use the BatchBuild.Result to drive retries.

jimk-bdrc commented 5 years ago

Fix strategy: somehow, log all the volumes which are in a build, pass them in as a set or tuple to updateBuildStatus. It would be a moderate string, only 300 -600 characters