Skip to content

Implement persistent scheduled status updates with retry and worker polling #5

Description

@laraibg786

Currently we are spawning a goroutine for each request that is done in the curfew hours. There are following issues with this:

  • These goroutines can be very long lived (upto a week). Such thing can lead to quick resource exhaustion in a busy app since we might be spawning more goroutines than we are completing.
  • The scheduled goroutines live in memory so this will not survive the server restarts.
  • There is no retry mechanism for the failed or timed out tries for the status updates.

Possible Solution

  1. store the info to change the status in the sqlite db with reasonable busy-timeout.
  2. have a goroutine polling the sqlite for the scheduled events in the last interval and tries to change the status one by one.
  3. mark the entry in database successful or unsuccessful depending on the status change.
  4. optionally implement the retry mechanism for the failed status updates. (future TODO)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions