Skip to content

Commit e262501

Browse files
committed
DPL: clean up leftovers from input stream after parsing a workflow
1 parent cb59999 commit e262501

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Framework/Core/src/WorkflowSerializationHelpers.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,19 @@ bool WorkflowSerializationHelpers::import(std::istream& s,
969969
WorkflowImporter importer{workflow, metadata, command};
970970
bool ok = reader.Parse(isw, importer);
971971
if (ok == false) {
972-
throw std::runtime_error("Error while parsing serialised workflow");
972+
if (s.eof()) {
973+
throw std::runtime_error("Error while parsing serialised workflow");
974+
} else {
975+
// clean up leftovers at the end of the input stream, e.g. [DEBUG] message from destructors
976+
while (true) {
977+
O2_SIGNPOST_ID_GENERATE(sid, workflow_importer);
978+
s.getline(buf, 1024, '\n');
979+
if (s.eof()) {
980+
break;
981+
}
982+
O2_SIGNPOST_EVENT_EMIT(workflow_importer, sid, "import", "Following leftover line found in input stream after parsing workflow: %{public}s", buf);
983+
}
984+
}
973985
}
974986
return true;
975987
}

0 commit comments

Comments
 (0)