Activity-Lang: failure will certainly not be signalled to the Job
doing so would contradict the fundamental architecture, all kinds of failures and timeouts need to be handled within Scheduler-Layer-2 rather. Jobs are never aborted, nor do they need to know if and when they are invoked
This commit is contained in:
parent
94528d67dc
commit
ab7f506f4b
10 changed files with 112 additions and 107 deletions
|
|
@ -51,23 +51,6 @@ namespace engine {
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
RenderDrive::signalFailure (JobParameter parameter, JobFailureReason reason)
|
||||
{
|
||||
UNIMPLEMENTED ("what needs to be done when a planning continuation cant be invoked?");
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
RenderDrive::verify (Time nominalTime, InvocationInstanceID invoKey) const
|
||||
{
|
||||
UNIMPLEMENTED ("the actual meat: advance the render process");
|
||||
return getTimings().isValid()
|
||||
&& Time::MIN < nominalTime && nominalTime < Time::MAX
|
||||
&& nominalTime == getTimings().getFrameStartAt (invoKey.frameNumber);
|
||||
}
|
||||
|
||||
|
||||
InvocationInstanceID
|
||||
RenderDrive::buildInstanceID (HashVal seed) const
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,12 +106,10 @@ namespace engine {
|
|||
return META_JOB;
|
||||
}
|
||||
|
||||
bool verify (Time, InvocationInstanceID) const override;
|
||||
size_t hashOfInstance (InvocationInstanceID) const override;
|
||||
InvocationInstanceID buildInstanceID(HashVal) const override;
|
||||
|
||||
void invokeJobOperation (JobParameter) override;
|
||||
void signalFailure (JobParameter, JobFailureReason) override;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,13 +82,6 @@ namespace gear {
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
Job::signalFailure (JobFailureReason reason) const
|
||||
{
|
||||
myClosure(this).signalFailure (parameter, reason);
|
||||
}
|
||||
|
||||
|
||||
/** find out about the classification of this job.
|
||||
* Typically its not necessary for the normal scheduling of
|
||||
* Jobs to know anything beyond the contents of the #lumiera_jobDescriptor,
|
||||
|
|
@ -97,22 +90,8 @@ namespace gear {
|
|||
JobKind
|
||||
Job::getKind() const
|
||||
{
|
||||
REQUIRE (isValid());
|
||||
return myClosure(this).getJobKind();
|
||||
}
|
||||
|
||||
|
||||
/** Render Job self verification.
|
||||
* performs a parameter consistency check
|
||||
* including a call-back to the defining JobTicket
|
||||
*/
|
||||
bool
|
||||
Job::isValid() const
|
||||
{
|
||||
return this->jobClosure
|
||||
and myClosure(this).verify (getNominalTime(),
|
||||
getInvocationInstanceID());
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
|
|
@ -155,8 +134,6 @@ namespace {
|
|||
forwardInvocation (lumiera_jobDefinition& jobDef)
|
||||
{
|
||||
Job& job = static_cast<Job&> (jobDef);
|
||||
|
||||
REQUIRE (job.isValid());
|
||||
return job;
|
||||
}
|
||||
}
|
||||
|
|
@ -172,13 +149,6 @@ lumiera_job_invoke (LumieraJobDefinition jobDef)
|
|||
forwardInvocation(*jobDef).triggerJob();
|
||||
}
|
||||
|
||||
void
|
||||
lumiera_job_failure (LumieraJobDefinition jobDef, JobFailureReason reason)
|
||||
{
|
||||
REQUIRE (jobDef);
|
||||
forwardInvocation(*jobDef).signalFailure(reason);
|
||||
}
|
||||
|
||||
size_t
|
||||
lumiera_job_get_hash (LumieraJobDefinition jobDef)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,15 +84,6 @@ enum JobPriority
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* @todo find out about the possible kinds of failure
|
||||
*/
|
||||
enum JobFailureReason
|
||||
{
|
||||
TIMEOUT,
|
||||
PREREQUISITE_NOT_AVAILABLE ///////////////TODO
|
||||
};
|
||||
|
||||
typedef int64_t FrameCnt;
|
||||
|
||||
|
||||
|
|
@ -241,10 +232,8 @@ namespace gear {
|
|||
|
||||
|
||||
virtual void invokeJobOperation (JobParameter parameter) =0;
|
||||
virtual void signalFailure (JobParameter,JobFailureReason) =0;
|
||||
|
||||
virtual JobKind getJobKind() const =0;
|
||||
virtual bool verify (Time, InvocationInstanceID) const =0;
|
||||
virtual HashVal hashOfInstance(InvocationInstanceID) const =0;
|
||||
virtual InvocationInstanceID buildInstanceID(HashVal)const =0; ////////////////////////////TICKET #1293 : a size_t hash? or a LUID?
|
||||
|
||||
|
|
@ -286,7 +275,6 @@ namespace gear {
|
|||
|
||||
|
||||
void triggerJob() const;
|
||||
void signalFailure (JobFailureReason) const;
|
||||
|
||||
|
||||
Time
|
||||
|
|
@ -302,7 +290,6 @@ namespace gear {
|
|||
}
|
||||
|
||||
JobKind getKind() const;
|
||||
bool isValid() const;
|
||||
|
||||
bool usesClosure (JobClosure const&) const;
|
||||
|
||||
|
|
@ -339,13 +326,6 @@ extern "C" {
|
|||
* assuming availability of all prerequisites */
|
||||
void lumiera_job_invoke (LumieraJobDefinition);
|
||||
|
||||
/** signal inability to invoke this job
|
||||
* @todo decide what and how to communicate details of the failure
|
||||
* @remarks the purpose of this function is to allow for reliable checkpoints
|
||||
* within the network of dependent job invocations, even after
|
||||
* missing deadlines or aborting a sequence of jobs */
|
||||
void lumiera_job_failure (LumieraJobDefinition, JobFailureReason);
|
||||
|
||||
/** calculate a hash value based on the Job's \em identity. */
|
||||
size_t lumiera_job_get_hash (LumieraJobDefinition);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,12 +65,6 @@ namespace gear {
|
|||
return META_JOB;
|
||||
}
|
||||
|
||||
bool
|
||||
verify (Time, InvocationInstanceID) const
|
||||
{
|
||||
return true; // always happy
|
||||
}
|
||||
|
||||
InvocationInstanceID
|
||||
buildInstanceID (HashVal) const override
|
||||
{
|
||||
|
|
@ -92,12 +86,6 @@ namespace gear {
|
|||
/* NOP */
|
||||
}
|
||||
|
||||
void
|
||||
signalFailure (JobParameter, JobFailureReason) override
|
||||
{
|
||||
///////////TODO do we ever need to notify anyone? can this even happen?
|
||||
}
|
||||
|
||||
public:
|
||||
NopJobFunctor();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -71,8 +71,6 @@ namespace test {
|
|||
verify_simple_job_properties()
|
||||
{
|
||||
MockJob job;
|
||||
CHECK (job.isValid());
|
||||
|
||||
Time beforeInvocation = RealClock::now();
|
||||
job.triggerJob();
|
||||
|
||||
|
|
@ -110,9 +108,7 @@ namespace test {
|
|||
: public JobClosure
|
||||
{
|
||||
void invokeJobOperation (JobParameter) { /* irrelevant */ }
|
||||
void signalFailure (JobParameter,JobFailureReason) { /* irrelevant */ }
|
||||
JobKind getJobKind() const { return META_JOB; }
|
||||
bool verify (Time, InvocationInstanceID) const { return false; }
|
||||
InvocationInstanceID buildInstanceID(HashVal) const { return InvocationInstanceID(); }
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -89,28 +89,12 @@ namespace test {
|
|||
invocationLog_[hash_value (parameter)] = Invocation(parameter);
|
||||
}
|
||||
|
||||
void
|
||||
signalFailure (JobParameter,JobFailureReason) override
|
||||
{
|
||||
NOTREACHED ("Job failure is not subject of this test");
|
||||
}
|
||||
|
||||
JobKind
|
||||
getJobKind() const override
|
||||
{
|
||||
return META_JOB;
|
||||
}
|
||||
|
||||
bool
|
||||
verify (Time nominalJobTime, InvocationInstanceID invoKey) const override
|
||||
{
|
||||
return Time::ANYTIME < nominalJobTime
|
||||
&& 0 <= invoKey.part.a
|
||||
&& invoKey.part.a < MAX_PARAM_A
|
||||
&& -MAX_PARAM_B <= invoKey.part.b
|
||||
&& invoKey.part.b < MAX_PARAM_B;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a specifically marked invocationKey for use in unit-tests.
|
||||
* @remark in the actual implementation, this function generates a distinct
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace test {
|
|||
simpleUsage();
|
||||
|
||||
verifyMockInvocation();
|
||||
verifyDummyJobFunctor();
|
||||
verifyMockJobFunctor();
|
||||
detect_activation();
|
||||
detect_gate();
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ namespace test {
|
|||
verifyMockInvocation()
|
||||
{
|
||||
ActivityDetector detector;
|
||||
auto fun = detector.buildDiagnosticFun<void(uint)>("funny");
|
||||
auto fun = detector.buildDiagnosticFun<void(uint)> ("funny");
|
||||
uint rnd = rand() % 10000;
|
||||
|
||||
++detector;
|
||||
|
|
@ -143,11 +143,13 @@ namespace test {
|
|||
|
||||
|
||||
/** @test TODO diagnostic setup to detect a JobFunctor activation
|
||||
* @todo WIP 7/23 ⟶ define ⟶ implement
|
||||
* @todo WIP 7/23 🔁 define ⟶ implement
|
||||
*/
|
||||
void
|
||||
verifyDummyJobFunctor()
|
||||
verifyMockJobFunctor()
|
||||
{
|
||||
ActivityDetector detector;
|
||||
JobFunctor& mockFunctor = detector.buildMockJobFunctor ("mockJob");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,8 @@
|
|||
//#include "steam/mobject/model-port.hpp"
|
||||
//#include "steam/engine/dispatcher.hpp"
|
||||
//#include "steam/engine/job-ticket.hpp"
|
||||
//#include "vault/gear/job.h"
|
||||
#include "vault/gear/job.h"
|
||||
#include "vault/gear/activity.hpp"
|
||||
//#include "vault/real-clock.hpp"
|
||||
//#include "lib/allocator-handle.hpp"
|
||||
//#include "lib/time/timevalue.hpp"
|
||||
|
|
@ -335,6 +336,11 @@ namespace test {
|
|||
return Functor{id, eventLog_, invocationSeq_};
|
||||
}
|
||||
|
||||
JobFunctor& ///////////////////////////////////////////////////////////////////TICKET #1287 : fix actual interface down to JobFunctor (after removing C structs)
|
||||
buildMockJobFunctor (string id)
|
||||
{
|
||||
UNIMPLEMENTED ("build a rigged JobFunctor");
|
||||
}
|
||||
|
||||
|
||||
ActivityMatch
|
||||
|
|
|
|||
|
|
@ -82429,9 +82429,16 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1682892700196" ID="ID_113377758" MODIFIED="1682892700196" TEXT="void signalFailure (JobParameter,JobFailureReason)">
|
||||
<node CREATED="1682892700196" ID="ID_113377758" MODIFIED="1692108233616" TEXT="void signalFailure (JobParameter,JobFailureReason)">
|
||||
<node BACKGROUND_COLOR="#f0d5c5" COLOR="#990033" CREATED="1682892704686" ID="ID_1226594521" MODIFIED="1682892718331" TEXT="macht das nicht beser Layer-2 im Scheduler?">
|
||||
<arrowlink COLOR="#c18992" DESTINATION="ID_1827409996" ENDARROW="Default" ENDINCLINATION="460;-40;" ID="Arrow_ID_269986431" STARTARROW="None" STARTINCLINATION="-174;11;"/>
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1692108241573" ID="ID_18582343" MODIFIED="1692108302189" TEXT="Prinzip: ganz oder gar nicht">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
<node CREATED="1692108310379" ID="ID_114242462" MODIFIED="1692108455901" TEXT="Problem: Rück-Kanal erforderlich">
|
||||
<arrowlink COLOR="#8d385a" DESTINATION="ID_1557327160" ENDARROW="Default" ENDINCLINATION="-382;-787;" ID="Arrow_ID_1536727958" STARTARROW="None" STARTINCLINATION="-595;52;"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -82463,6 +82470,11 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1692108072539" ID="ID_1827409996" MODIFIED="1692108369187" TEXT="Umgang mit Fehlern">
|
||||
<arrowlink COLOR="#6f6ea7" DESTINATION="ID_774705986" ENDARROW="Default" ENDINCLINATION="-559;-416;" ID="Arrow_ID_1863875541" STARTARROW="None" STARTINCLINATION="-199;23;"/>
|
||||
<linktarget COLOR="#c18992" DESTINATION="ID_1827409996" ENDARROW="Default" ENDINCLINATION="460;-40;" ID="Arrow_ID_269986431" SOURCE="ID_1226594521" STARTARROW="None" STARTINCLINATION="-174;11;"/>
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#d2beaf" COLOR="#5c4d6e" CREATED="1682040285134" ID="ID_1653553289" MODIFIED="1682040299541" TEXT="Performance-Belange">
|
||||
<icon BUILTIN="hourglass"/>
|
||||
|
|
@ -82868,6 +82880,92 @@ Date:   Thu Apr 20 18:53:17 2023 +0200<br/>
|
|||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#d2beaf" COLOR="#5c4d6e" CREATED="1692106070635" ID="ID_774705986" MODIFIED="1692108424314" TEXT="Umgang mit Fehlern">
|
||||
<linktarget COLOR="#6f6ea7" DESTINATION="ID_774705986" ENDARROW="Default" ENDINCLINATION="-559;-416;" ID="Arrow_ID_1863875541" SOURCE="ID_1827409996" STARTARROW="None" STARTINCLINATION="-199;23;"/>
|
||||
<icon BUILTIN="hourglass"/>
|
||||
<node CREATED="1692106078955" ID="ID_765119942" MODIFIED="1692106086249" TEXT="Arten von Fehlern">
|
||||
<icon BUILTIN="info"/>
|
||||
<node CREATED="1692106118368" ID="ID_1027109210" MODIFIED="1692106361481" TEXT="Render-Absicht nicht realisierbar">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Ein Render-Vorgang wurde in die Wege geleitet, aber beim Bereitstellen der Mittel zeigt sich, daß das beabsichtigte Ziel grundsätzlich oder akzidenteller Weise gar nicht erreichbar ist
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<node CREATED="1692106983907" ID="ID_994742026" MODIFIED="1692106997629" TEXT="muß vor Beginn ausgeschlossen werden"/>
|
||||
<node CREATED="1692106998753" ID="ID_111463742" MODIFIED="1692107009516" TEXT="Render-Vorgang darf überhaupt nicht erst beginnen"/>
|
||||
</node>
|
||||
<node CREATED="1692106135973" ID="ID_968435650" MODIFIED="1692106457557" TEXT="Vorraussetzungen nicht gewährleistet">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Ein grunsätzlich bereits komplett vorgeplanter Render-Vorgang stellt wider erwarten fest, daß eine Prüfung oder Annahme falsch war und eine Vorbedingung nicht erfüllt werden kann bzw. ein Arbeitsmittel doch nicht verfügbar ist
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<node CREATED="1692107178938" ID="ID_1998523203" MODIFIED="1692107186427" TEXT="wird grundsätzlich nicht toleriert"/>
|
||||
<node CREATED="1692107117410" ID="ID_1473230382" MODIFIED="1692107460794" TEXT="der komplette Play-Prozess wird sofort angehalten (pausiert, deaktiviert)">
|
||||
<linktarget COLOR="#8a5264" DESTINATION="ID_1473230382" ENDARROW="Default" ENDINCLINATION="-245;10;" ID="Arrow_ID_97368068" SOURCE="ID_1085931202" STARTARROW="None" STARTINCLINATION="-108;-6;"/>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1692106172152" ID="ID_1148722986" MODIFIED="1692106538248" TEXT="Timeout / Zeitrahmen überschritten">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Obwohl die Render-Aktivitäten komplett wie geplant ablaufen, ist zum aktuellen Zeitpunkt der vorgeplante Zeitrahmen verlassen, so daß Termine absehbar nicht mehr gehalten werden können
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<node CREATED="1692107188529" ID="ID_1469280145" MODIFIED="1692107195908" TEXT="soll möglichst frühzeitig erkannt werden"/>
|
||||
<node CREATED="1692107196496" ID="ID_1701852314" MODIFIED="1692107256427" TEXT="der aktuelle Aktivitäts-Term (i.d.R ein Frame) wird sofort aufgegeben"/>
|
||||
<node CREATED="1692107264255" ID="ID_518882099" MODIFIED="1692107287047" TEXT="das jeweilige Ausgabe-Protokoll muß auf solche Ausfälle tolerant reagieren können"/>
|
||||
</node>
|
||||
<node CREATED="1692106216738" ID="ID_440912262" MODIFIED="1692106644685" TEXT="Berechnung entgleist">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Ein unerwartetes Ereignis mitten in der Berechnung führt zum Kontrollverlust oder korumpiert die bereitgestellten Daten
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<node CREATED="1692107332414" ID="ID_833410414" MODIFIED="1692107341089" TEXT="wird grundsätzlich nicht toleriert"/>
|
||||
<node CREATED="1692107342172" ID="ID_1085931202" MODIFIED="1692107476836" TEXT="wie verletzte Vorausetzungen zu behandeln">
|
||||
<arrowlink COLOR="#8a5264" DESTINATION="ID_1473230382" ENDARROW="Default" ENDINCLINATION="-245;10;" ID="Arrow_ID_97368068" STARTARROW="None" STARTINCLINATION="-108;-6;"/>
|
||||
</node>
|
||||
<node CREATED="1692107362263" ID="ID_700158341" MODIFIED="1692107381676" TEXT="Play-Prozess bleibt stehen (deaktiviert)"/>
|
||||
</node>
|
||||
<node CREATED="1692106266636" ID="ID_1332585145" MODIFIED="1692107089603" TEXT="Degradierung">
|
||||
<richcontent TYPE="NOTE"><html>
|
||||
<head/>
|
||||
<body>
|
||||
<p>
|
||||
Im Rahmen normaler Verarbeitung wird ein nebenbei beobachteter Schwellwert verletzt, so daß das Ergebnis — wiewohl formal korrekt — nicht mehr den ursprünglichen Erwartungen genügt; es handelt sich hierbei um ein Ereignis, welches bekanntermaßen mit einer gewissen Wahrscheinlichkeit eintreten kann, beispielsweise um die Verzögerung oder Übertragungsstörung eines Remote-Feed, oder um eine limitierte Resource, die in geringerem Maß oder erst später als erwartet zur Verfügung steht
|
||||
</p>
|
||||
</body>
|
||||
</html></richcontent>
|
||||
<node CREATED="1692107501527" ID="ID_387100608" MODIFIED="1692107514273" TEXT="hierzu müßte ein dedizierter Mechanismus vorgesehen werden"/>
|
||||
<node CREATED="1692107514944" ID="ID_494673907" MODIFIED="1692107529791" TEXT="es gäbe dann einen Schwellwert"/>
|
||||
<node CREATED="1692107530547" ID="ID_548035075" MODIFIED="1692107537534" TEXT="und mehrere Reaktionsmuster">
|
||||
<node CREATED="1692107596435" ID="ID_1952815240" MODIFIED="1692107645168" TEXT="beispielsweise warten (Hintergrundverarbeitung)"/>
|
||||
<node CREATED="1692107609548" ID="ID_422624506" MODIFIED="1692107626194" TEXT="oder eine Weiche im Processing-Chain umstellen"/>
|
||||
</node>
|
||||
<node CREATED="1692107575413" ID="ID_1589653594" MODIFIED="1692107587532" TEXT="diese Regulierung liegt außerhalb des Schedulers">
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node CREATED="1692108332315" ID="ID_1557327160" MODIFIED="1692108455901" TEXT="Problem des Rückwirkungs-Kanals">
|
||||
<linktarget COLOR="#8d385a" DESTINATION="ID_1557327160" ENDARROW="Default" ENDINCLINATION="-382;-787;" ID="Arrow_ID_1536727958" SOURCE="ID_114242462" STARTARROW="None" STARTINCLINATION="-595;52;"/>
|
||||
<node CREATED="1692108491595" ID="ID_1176302529" MODIFIED="1692108510668" TEXT="ein Signalisierungs-Interface muß weithin zugänglich sein"/>
|
||||
<node CREATED="1692108511352" ID="ID_316055460" MODIFIED="1692108529978" TEXT="aber Ausnahme-Situationen sind an einen sehr spezifischen Kontext gebunden"/>
|
||||
<node CREATED="1692108530641" ID="ID_991521612" MODIFIED="1692108564761" TEXT="die Stelle, die die Ausnahme erkennt, kennt i.d.R. diesen (=ihren eigenen) Kontext nicht"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1680563509728" ID="ID_1883500842" MODIFIED="1684869810400" TEXT="Scheduler">
|
||||
<icon BUILTIN="stop"/>
|
||||
|
|
|
|||
Loading…
Reference in a new issue