Merge branch 'release_22.01' into dev

This commit is contained in:
Nicola Soranzo
2022-04-21 11:43:07 +01:00
6 changed files with 31 additions and 6 deletions
@@ -1,5 +1,5 @@
<template>
<div v-if="!jobSourceType || jobSourceType == 'Job' || isTerminal">
<div v-if="!jobSourceType || jobSourceType == 'Job' || (isTerminal && !isErrored)">
{{ simpleDescription }}
</div>
<div v-else-if="!jobStatesSummary || !jobStatesSummary.hasDetails()">
@@ -51,6 +51,9 @@ export default {
return DC_VIEW.collectionDescription(this.collection);
},
errorDescription() {
if (this.isPopulationFailed) {
return `${this.collection.get("populated_state_message")}`;
}
var jobCount = this.jobCount;
var errorCount = this.jobStatesSummary.numInError();
return `a ${this.collectionTypeDescription} with ${errorCount} / ${jobCount} jobs in error`;
+3
View File
@@ -7,6 +7,9 @@ export default {
isErrored() {
return this.jobStatesSummary && this.jobStatesSummary.errored();
},
isPopulationFailed() {
return this.jobStatesSummary && this.jobStatesSummary.populationFailed();
},
isTerminal() {
return this.jobStatesSummary && this.jobStatesSummary.terminal();
},
@@ -252,6 +252,15 @@ var DatasetCollection = Backbone.Model.extend(BASE_MVC.LoggableMixin)
_.extend(element, {
parent_hdca_id: parentHdcaId,
});
// Warning: MEGA-hack ahead...
if (!element.element_type && !element.object) {
// The DCE has to be in error state... so we simulate it
_.extend(element, {
element_type: "hda",
object: { state: "error" },
});
}
});
this.elements = new collectionClass(elements);
//this.debug( 'collectionClass:', this.collectionClass + '', this.elements );
+6 -1
View File
@@ -62,11 +62,16 @@ var CollectionView = _super.extend(
},
handleWarning: function ($newRender) {
var $warns = $newRender.find(".elements-warning");
if (this.model.get("populated_state") === "failed") {
var error = _l(`${this.model.get("populated_state_message")}`);
$warns.html(`<div class="errormessagesmall">${error}</div>`);
return;
}
var viewLength = this.views.length;
var elementCount = this.model.get("element_count");
if (elementCount && elementCount !== viewLength) {
var warning = _l(`displaying only ${viewLength} of ${elementCount} items`);
var $warns = $newRender.find(".elements-warning");
$warns.html(`<div class="warningmessagesmall">${warning}</div>`);
}
},
+6 -1
View File
@@ -7,6 +7,7 @@ var UPDATE_DELAY = 2000;
var NON_TERMINAL_STATES = ["new", "queued", "running", "waiting"];
var ERROR_STATES = ["error", "deleted"];
var TERMINAL_STATES = ["ok"].concat(ERROR_STATES);
const POPULATED_STATE_FAILED = "failed";
/** Fetch state on add or just wait for polling to start. */
var FETCH_STATE_ON_ADD = false;
var BATCH_FETCH_STATE = true;
@@ -26,8 +27,12 @@ var JobStatesSummary = Backbone.Model.extend({
return !this.hasDetails() || this.get("populated_state") == "new";
},
populationFailed: function () {
return this.get("populated_state") === POPULATED_STATE_FAILED;
},
errored: function () {
return this.get("populated_state") === "error" || this.anyWithStates(ERROR_STATES);
return this.populationFailed() || this.anyWithStates(ERROR_STATES);
},
states: function () {
+3 -3
View File
@@ -357,7 +357,7 @@ class IRODSObjectStore(DiskObjectStore, CloudConfigMixin):
# Ensure the cache directory structure exists (e.g., dataset_#_files/)
rel_path_dir = os.path.dirname(rel_path)
if not os.path.exists(self._get_cache_path(rel_path_dir)):
os.makedirs(self._get_cache_path(rel_path_dir))
os.makedirs(self._get_cache_path(rel_path_dir), exist_ok=True)
# Now pull in the file
file_ok = self._download(rel_path)
self._fix_permissions(self._get_cache_path(rel_path_dir))
@@ -502,7 +502,7 @@ class IRODSObjectStore(DiskObjectStore, CloudConfigMixin):
if dir_only and base_dir:
# for JOB_WORK directory
if not os.path.exists(rel_path):
os.makedirs(rel_path)
os.makedirs(rel_path, exist_ok=True)
log.debug("irods_pt _exists: %s", ipt_timer)
return True
log.debug("irods_pt _exists: %s", ipt_timer)
@@ -530,7 +530,7 @@ class IRODSObjectStore(DiskObjectStore, CloudConfigMixin):
# Create given directory in cache
cache_dir = os.path.join(self.staging_path, rel_path)
if not os.path.exists(cache_dir):
os.makedirs(cache_dir)
os.makedirs(cache_dir, exist_ok=True)
if not dir_only:
rel_path = os.path.join(rel_path, alt_name if alt_name else f"dataset_{self._get_object_id(obj)}.dat")