Skip to content

Further Optimize Maintainer Loop Logging #84

Description

@adeutscher

As I'm local-testing #75 , I find myself already a bit annoyed by the idempotency monitor announcement that I set up yesterday. It still maintains an important purpose, but also there's no point in re-checking if we know for a fact that there aren't any messages to handle. I think that we can improve on that.

Rough ideas with minimal impact to existing infrastructure:

  • Rename the maintainer delay to be more indicative of our plans, like MaintainerWaitAsync
  • If the number of in-flight jobs stored in the applied execution end arbiter is greater than zero, then sleep for the appointed amount of time through sleep service as we currently do.
    • For the idempotency monitor specifically, this is "good enough", since getting callbacks when the message state is adjusted is already documented elsewhere as a 'cure-worse-than-the-disease' kind of problem for similar logistics.
  • If the number of of in-flight jobs stored in the applied execution end arbiter is zero, then pass off to waiting on a manual-reset-event.
    • Event state is managed by update callback for watched jobs.
    • This way, the heartbeat monitor and idempotency monitors only loop when there's a point in looping.
  • Possible alternative idea: The manual-reset-event is always awaited before the standard delay, thus preventing monitor checks from running the instant a relevant job comes in. A brand-new job doesn't need to be heartbeated.
    • Maybe still gate an informative log message on event state? (related topic: can we gate an if statement on the event's state? Question for later).

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