-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
- Check the assumption that there may be a bug in `setTimeout` implementation when it's called with no timeout value. - Bring back the console log statement printed after a benchmark is finished but before we schedule the next one. This should give us visibility into the question whether Voyager gets stuck inside the benchmark code or in the main loop logic. Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@juliangruber I don't know the ramifications of introducing a 100ms delay between benchmarks. Will it reduce the number of checks performed by our network too much? We can choose a smaller delay, but OTOH, I think the timer precision is around 50ms, so using a value smaller than 50ms may not make sense. |
Yes, unfortunately this will negatively affect the amount of tests Voyager schedules. What about instead we |
Yeah, I was worried that could be the case.
That should work. Is there any particular reason why we cannot run a async run () {
while (true) {
const started = Date.now()
try {
await this.nextRetrieval()
this.#activity.onHealthy()
} catch (err) {
this.handleRunError(err)
}
const duration = Date.now() - started
const baseDelay = APPROX_ROUND_LENGTH_IN_MS / this.#maxTasksPerNode
const delay = baseDelay - duration
if (delay > 0) {
console.log('Sleeping for %s seconds before starting the next task...', Math.round(delay / 1000))
await sleep(delay)
}
}
} |
No particular reason, just that we wanted to keep the module code as close to the original service worker as possible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you suggested, a while (true)
would be great
Opened #6 I also realised that |
Check the assumption that there may be a bug in
setTimeout
implementation when it's called with no timeout value.Bring back the console log statement printed after a benchmark is finished but before we schedule the next one. This should give us visibility into the question whether Voyager gets stuck inside the benchmark code or in the main loop logic.
Links: