SGrondin / bottleneck

Job scheduler and rate limiter, supports Clustering
MIT License
1.83k stars 79 forks source link

Invalid job status null, expected QUEUED. #189

Open aakashjw opened 3 years ago

aakashjw commented 3 years ago

Getting the issue: Invalid job status null, expected QUEUED. Please open an issue at https://github.com/SGrondin/bottleneck/issues

Trace:

at Job._assertStatus(.../bottleneck/lib/Job.js:77:13)
at Job.doRun(.../bottleneck/lib/Job.js:105:12)
at Bottleneck._run (.../bottleneck/lib/Bottleneck.js:193:11)
at (.../bottleneck/lib/Bottleneck.js:256:18)

Current settings: highWater: 0, strategy: BLOCK

I want to block any requests that are beyond allowed requests without maintaining a queue, so I am setting highWater = 0.

Please let me know what could be an issue here?

colin-oos commented 2 years ago

I am having the same issue. I don't get it all the time but I get this error sometimes while using Bottleneck.Group and clustering (with ioredis). Options are set as:

{
  strategy: Bottleneck.strategy.LEAK,
  highWater: 100,
  minTime: 333,
  maxConcurrent: 1,
  timeout: 15000,
  connection // a Bottleneck.IORedisConnection
}