Closed marusshi closed 6 years ago
Cool, I'm gonna paraphrase this problem for clarity:
Scheduler
wants to use current device stats for its calculation, but it could happen that a newly launched CodeEngine
has not reported its stats (e.g. available memory) yet. Scheduler
will throw an error complaining it does not have stats about this new CodeEngine
.
I think we should change this so that if a data point is not available yet, we approach it conservatively and say that the device has 0 available memory. Let's discuss this in the meeting.
Patched in 17a704056d4afa5d760af5d756b63e8be4929471
When a new Code Engine instance begins to run, it publishes its existence to the topic
engine-registry
. Dispatcher listens to this topic to keep a mapping of all existing engines inthis.engines
.Scheduler, who inherits from Dispatcher, takes this mapping when finding available devices (
Scheduler.js:136
inScheduler.prototype._assess
):If a Code Engine instance exits the network after it publishes its existence to
engine-registry
but before it publishes its status in asetInterval
reportStatus()
call, the following exception will be thrown: