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
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 theenqueueBlocking()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:
runCtx.RunInfo.QueueTime = time.Now()QueueEventTypeQueueAddedpriorityparameter for the event priority