conductor icon indicating copy to clipboard operation
conductor copied to clipboard

Negative queueWaitTime when callbackAfterSeconds set after first poll

Open nbraquart opened this issue 9 years ago • 2 comments

Hello,

I encountered a weird situation under which queueWaitTime computed attribute became negative for one task execution.

The scenario is the following:

  1. Task is scheduled at 09:00:00
  2. Task is polled at 09:00:02 ==> At this moment, queueWaitTime is 2 seconds
  3. Task is updated with status IN_PROGRESS and a callbackAfterSeconds of 900 seconds (cf recommendation here: https://netflix.github.io/conductor/faq/#how-do-you-schedule-a-task-to-be-put-in-the-queue-after-some-time-eg-1-hour-1-day-etc) ==> Now queue wait time is -898 seconds

This comes from the way queueWaitTime is computed: startTime - scheduledTime - callbackAfterSeconds. This the value of callbackAfterSeconds has changed, this formula is not valid (it should take the callbackAfterSeconds with which the start was set).

WDYT?

Thanks! Nicolas

nbraquart avatar Nov 02 '17 16:11 nbraquart

Hello,

we are facing the same issue. Any update/suggestion regarding this topic?

Thank you, Robert

parakr avatar Oct 29 '19 09:10 parakr

Thanks for flagging this (somehow has slipped through the cracks). We will look into fixing this in a future release. However, in the meantime, please feel free to contribute a fix for this issue.

apanicker-nflx avatar Oct 29 '19 17:10 apanicker-nflx