bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

feat(job): implement moveToWaitingChildren for sandboxed jobs

Open shichongrui opened this issue 8 months ago • 2 comments

Why

moveToWaitingChildren is not implemented on sandboxed jobs. The docs don't explain this and from what I could see there was no reason for it not to be other than that it just wasn't implemented there.

How

I followed the same approach that the moveToDelayed function uses in a sandboxed job to send commands back to the parent process to actually execute the functionality.

Additional Notes (Optional)

I did not see any tests for moveToDelayed that tested from within a sandboxed process so I wasn't sure if there was somewhere to add tests for this functionality.

I've done a yarn pack and then untarred it in a local bullmq project and confirmed that it was working though.

Fixes #3230

shichongrui avatar Apr 20 '25 04:04 shichongrui

Not having a test for moveToDelayed was definitely an overlook from out part, we will fix it asap.

manast avatar Apr 21 '25 22:04 manast

I actually checked in the codebase and there is indeed a test for moveToDelayed, you can use it for inspiration for your moveToWaitingChildren: https://github.com/taskforcesh/bullmq/blob/master/tests/test_sandboxed_process.ts#L892

manast avatar Apr 24 '25 19:04 manast

just faced the same issue today. Is there any plan to finish this PR @shichongrui ? I see @ocke had plans to work on it as well

UPD: I went ahead and implemented it here: #3389

pkudinov avatar Aug 11 '25 07:08 pkudinov