trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

bug: [v4] parent function where all sub tasks are cached runs forever

Open cachho opened this issue 8 months ago • 2 comments

Provide environment information

System: OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor Memory: 6.32 GB / 15.59 GB Container: Yes Shell: 3.7.1 - /usr/bin/fish Binaries: Node: 18.20.8 - ~/.local/share/nvm/v18.20.8/bin/node npm: 10.8.2 - ~/.local/share/nvm/v18.20.8/bin/npm pnpm: 8.6.3 - ~/.local/share/pnpm/pnpm

Describe the bug

I have a trigger function that calls multiple child trigger functions. They are all cached. It now runs forever.

Image

The child tasks don't have runs:

Image

Which you also see when going through the batch menu, it's running forever,

Image

But clicking a batch shows no runs.

Image

Reproduction repo

not available

To reproduce

The child tasks are triggered with

      const results = await decryptLink.batchTriggerAndWait(
        linksInChunk.map((link) => ({
          payload: { link: link! },
          options: {
            idempotencyKey: link!,
            idempotencyKeyTTL: '1d',
          },
        }))
      );

Only tested in development.

Additional information

It could be a problem with how the parent function works or caching or the batch trigger itself.

cachho avatar Apr 20 '25 22:04 cachho

I simplified my function and removed the chunking (here's why I used it: https://feedback.trigger.dev/p/support-more-than-100-items-in-batchtrigger-at-once).

I can confirm that the issue is still here.

cachho avatar Apr 20 '25 22:04 cachho

#1958 - looks like this has more to do with idempotency keys and less with whether they have been cached before or not. Still keeping this open, because I can't be sure.

cachho avatar Apr 22 '25 09:04 cachho

@cachho this should be fixed in the latest v4 beta. Update to the latest package and redeploy your code.

matt-aitken avatar Apr 28 '25 16:04 matt-aitken