Skip to content

(Bug) enqueue() does not record when a run is added to the queue, causing invalid queue delay metrics #142

@pratham15541

Description

@pratham15541

The Queue.enqueue() function is supposed to add a "run" (a task to be processed) to the queue. But in the old code, after adding the run, it does not record the time when the run was added, and it does not send an event to say "a run was added to the queue." This is different from the enqueueBlocking() function, which does both.

Because of this, when the system later tries to calculate how long a run waited in the queue, it might use a zero or missing time, which makes the wait time metrics wrong.

To fix this, enqueue() should:

  • set runCtx.RunInfo.QueueTime = time.Now()
  • emit QueueEventTypeQueueAdded
  • use the priority parameter for the event priority

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions