Skip to content

(fix) wrong queue delay calculation - #143

Open
pratham15541 wants to merge 1 commit into
omegaup:mainfrom
pratham15541:fix/wrong-wait-time-calculation
Open

pratham15541 wants to merge 1 commit into
omegaup:mainfrom
pratham15541:fix/wrong-wait-time-calculation

Conversation

@pratham15541

@pratham15541 pratham15541 commented Mar 21, 2026

Copy link
Copy Markdown

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

Fixes: #142

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant