jobId does not affect on equals Job`s?

This issue has been created since 2022-07-13.

Hi!
I have a code:

//setup queue
  queue['queueEvents'].on('active', async ({ jobId }) => {
    console.info(`process in queue started ${jobId}`)
  })
  queue['queueEvents'].on('completed', ({ jobId, returnvalue }) => {
    console.info(`process in queue completed ${jobId}`)
  })

...

//callRunJob
const delay = 0    
const jobId = uuidv4()
const job = queue.add(scriptPath, params, { jobId, delay })

If I add multiple jobs in one time with identical scriptPath and params, BUT with different jobId ,- the queue behavior looks like sync.
And on the other side if repeat it with different params,- jobs behavior looks like async.

Log with identical scriptPath and params (the jobId different!)

2022-07-13 14:04 +00:00: process in queue started e9603f9e-76ff-4ef0-b395-5b6f954630cc
2022-07-13 14:04 +00:00: process in queue completed e9603f9e-76ff-4ef0-b395-5b6f954630cc
2022-07-13 14:04 +00:00: process in queue started bb3c628e-1809-42e8-b193-7c6b0f22f3d7
2022-07-13 14:04 +00:00: process in queue completed bb3c628e-1809-42e8-b193-7c6b0f22f3d7
2022-07-13 14:04 +00:00: process in queue started 277c6e6e-7396-40b3-bfe3-47feb34cc028
2022-07-13 14:04 +00:00: process in queue completed 277c6e6e-7396-40b3-bfe3-47feb34cc028

And logs with different scriptPath and params (the jobId still different!)

2022-07-13 14:03 +00:00: process in queue  started 1207564c-1c10-4c43-a819-d60150c78adf
2022-07-13 14:03 +00:00: process in queue started 3c6cbb29-119d-4c9c-8bf6-ca3c8998db30
2022-07-13 14:03 +00:00: process in queue started 45c99da1-4df8-4695-9e42-da44e6ad18c2
2022-07-13 14:03 +00:00: process in queue completed 1207564c-1c10-4c43-a819-d60150c78adf
2022-07-13 14:03 +00:00: process in queue completed 3c6cbb29-119d-4c9c-8bf6-ca3c8998db30
2022-07-13 14:03 +00:00: process in queue completed 45c99da1-4df8-4695-9e42-da44e6ad18c2

Why jobId not have affect on sync/async behavior of queue with identical params?

roggervalf wrote this answer on 2022-07-17

hi @andrejs82git, jobId is just the job identifier, if you add jobs to the same queue, jobs will be processed in the same order that you added those jobs, on the other hand, if each job is added to different queues, worker will pick and process jobs in parallel as soon as they are in the wait list (jobs in each queue are processed in order as you are adding more jobs per each queue). So ordering or processing is not affected by the jobId.

andrejs82git wrote this answer on 2022-07-17

Hi @roggervalf, yes you right,-queue should be going one after one, but my worker have property opts.concurrency=10.

Sorry, I should write about that in thirst post.

manast wrote this answer on 2022-07-17

@andrejs82git currently it is not possible to guarantee sequentiality of the jobs as for example they get affected by things like retries and/or rate limit. You could use the Pro version and define a max concurrency per group but then you will need to disable retries and if you want to guarantee order:
https://docs.bullmq.io/bullmq-pro/groups/concurrency

andrejs82git wrote this answer on 2022-07-17

Hi @manast, thank for our reply!
I am not need order, i need concurency.
My issue that: with equal params and with different jobId(!) , behavior of queue is ordered.

manast wrote this answer on 2022-07-17

@andrejs82git can you write a small test case that we can run that exhibits the behaviour so that we can look into it?

andrejs82git wrote this answer on 2022-07-17

I write little example https://codesandbox.io/s/priceless-germain-dh01do?file=/index.js

But sync behavior not replaying :(

I should think about that. ¯_(ツ)_/¯

manast wrote this answer on 2022-07-17

What is the expected behaviour of your code? I recommend you remove stuff like http servers and try to create a simple to run test that exhibits the issue that you are getting.

More Details About Repo
Owner Name taskforcesh
Repo Name bullmq
Full Name taskforcesh/bullmq
Language TypeScript
Created Date 2018-12-19
Updated Date 2022-09-29
Star Count 2819
Watcher Count 21
Fork Count 223
Issue Count 195

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
getOrders SP-API InvalidInput error 400 6 2022-01-04 2022-04-10
404 error on Messaging API link 0 2022-01-01 2022-07-18
PS3 Save states not working 9 2019-07-10 2022-09-19
Testing only in Localhost can create problem 0 2021-01-12 2022-09-09
The cluster argument in rep.fixest() does not work for non-clustered se 1 2022-01-23 2022-08-24
`mvsw` function with fixed effects leads to error 1 2022-01-28 2022-08-24
Polymorphed dwarves lose their promoted sprite 0 2022-02-24 2022-07-22
实现 npm i hexo-theme-nexmoe 安装主题 1 2021-01-18 2022-09-25
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=io.realm Code=9 "mmap() failed: Cannot allocate memory size: 55672832 offset: 335544320" 6 2022-05-26 2022-09-25
[GraphSAGE] Positive and negative node pairs 2 2021-07-05 2022-09-06
Website Issue | Broken link 1 2022-04-07 2022-08-22
ImageQuality = 0 makes boot loop 1 2022-01-04 2022-09-04
CSharp code generation doesn't avoid user of the 'operator' keyword as a variable name 1 2021-07-22 2022-08-19
Motorola sparse images not mountable 1 2020-09-11 2022-09-07
Missing temperature sensors 1 2022-07-13 2022-09-17
SpongeBob: Battle for Bikini Bottom: Error pg-> color_binding || pg-> zeta_binding 1 2021-10-23 2022-09-02
On Windows, pip won't update OpenCC to the latest 1.1.2 version, due to missing wheel file 3 2021-05-28 2022-09-05
Download button has weird space in between o and w 14 2021-03-03 2022-09-24
An exception occurs after multi-match statement executed multiple times 7 2022-07-15 2022-08-10
Uncaught TypeError: _a2.getTime is not a function 2 2022-03-16 2022-09-27
Editor scrolls while copy->paste long content 1 2022-05-01 2022-09-24
Feature request: make the downloading of a new version visible to the user 0 2022-07-13 2022-09-05
UI Bug on re-loading connector config with oneOf 0 2021-10-25 2022-08-18
On latest, the module event-store-mem doesn't compile any more 1 2022-06-09 2022-08-31
User Fed: hardcoded-ldap-role-mapper has buggy modal 1 2021-11-03 2022-09-19
Installing gulp-cli globally & installing gulp locally ENOENT 1 2022-06-02 2022-09-27
Mylar's `series.json` fields have changed 1 2022-05-31 2022-09-26
Clementine unable to see / sync to Samsung S22 Ultra 0 2022-08-04 2022-09-18
Having .po files in one folder for each language 5 2021-04-07 2022-09-16
validate secrets at the time of creation 0 2020-06-11 2022-08-27
Firefox segfaults on ARM64 if built with mold 9 2022-06-14 2022-09-02
CollapsePanel: onItemClick can not trigger 1 2022-06-29 2022-09-25
[FEATURE] Disable log colors if environment variable is set 2 2021-07-17 2022-09-26
news.abplive.com 0 2022-01-15 2022-01-16
Alternate Cropping Solution 0 2022-09-07 2022-09-23
Advanced search module: select user from pop up "Assigned to" Fail (TypeError: parent._trigger_up is not a function) 0 2022-07-27 2022-09-20
Collect artifact's usage count: Make current BI board support new application id. 1 2022-01-06 2022-08-10
[windows] Installer shouldn't ask to remove all data during package upgrades 7 2022-05-29 2022-09-15
CSS override 1 2017-12-26 2022-01-21
HASS OS freezes after ~40 seconds on proxmox 7 2021-11-23 2022-09-26
VSCODE.dev connect to remote vscode instance and access feature 4 2022-06-11 2022-09-20
Support for Automation Hybrid Runbook Worker Group 6 2021-12-15 2022-09-05
https://github.com/mostafakili 2 2022-02-15 2022-08-04
Update cluster-monitoring repo to latest version 1 2020-05-26 2022-07-27
new invalid bearer token, square/go-jose: error in cryptographic primitive 11 2022-05-05 2022-08-21
[data.search] Remove remaining usages of _source 2 2022-01-27 2022-07-26
shared-utils and core using vulnerable dependency CVE-2020-28469 0 2021-09-27 2022-09-24
"Cards" component in "Radio Group" focus border is potentially bugged 5 2021-11-11 2022-09-21
[CP] Ensure pre-rolled opacity children see snapped matrix 2 2022-09-15 2022-09-09
go_router - redirect to home page when no routes is matched 1 2022-09-15 2022-09-09