Skip to content

Retry sooner than every 24h in case of unavailable base schedule #111

@thbar

Description

@thbar

The work done in #107/#109 already improved the boot process by ensuring that a dataset is not "unregistered" (disappears from the routes) completely until next deploy if the static part is not available at boot time.

After #109 is merged, though, in case of unavailability at boot, the dataset download will only be retried 24h later at the moment, via this code:

impl actix::Actor for BaseScheduleReloader {
type Context = actix::Context<Self>;
fn started(&mut self, ctx: &mut Self::Context) {
info!(self.log, "Starting the base schedule updater actor");
ctx.run_interval(std::time::Duration::from_secs(60 * 60 * 24), |act, ctx| {
info!(act.log, "reloading baseschedule data");
act.update_data(ctx);
});
}
}

Detecting the unavailability (at boot and also later) and rescheduling with shorter timeframes (possibly with a form of backoff) would be a real improvement.

Todos

  • Figure out how to move forward in time, to implement proper tests on this workflow. It could be done via introspection of scheduled run_interval in Actix, if available, or via another form of tweak.
  • Make sure to avoid cascading downloads (e.g. all of a sudden, we end up downloading multiple times) - see cascading failures in distributed systems for the overall idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions