Command rejected with code 'COMPLETE'

This sounds like the timeout on the job activation is too low.

That looks like this:

  1. Your worker requests two jobs, and gets one.
  2. Worker starts working on the job.
  3. Worker keeps polling, because it has max jobs activate 2, and one job active.
  4. Broker times out activation of the job, and schedules it for reactivation.
  5. Worker polls, and activates the same job.
  6. Worker starts working on the same job in another thread.
  7. Thread 1 completes the job and calls the CompleteJob API, getting the empty (success) response.
  8. Thread 2 completes the job and calls the CompleteJob API, getting the error response.

The job has been done twice, so the email got send twice to the customer, unless you designed the worker to avoid duplication. And the second activation gets an error when it tries to complete.

Josh

1 Like