Skip to content

Race condition when trying to use more than one cloud tasks instance #3059

Closed

Description

@amfc

Environment is irrelevant, but I'm using ubuntu 25.04 with firebase admin 13.6.0, cloud tasks, node 20 and npm 10.8.2.

When using multiple Firebase apps (e.g., one for emulator, one for production), there's a race condition because CLOUD_TASKS_EMULATOR_HOST is read on every operation instead of being cached in the constructor like Auth and Storage.

This makes it impossible to safely use an emulator app and a production app in the same process as when you connect to an emulator all calls go there.

It's trivial to fix, I'll provide a patch.

Activity

  1. amfc commented on Jan 29, 2026

    @amfc
    Author

    firebase-admin-cloud-tasks-emulator-fix.patch

    patch src/functions/functions-api-client-internal.ts < firebase-admin-cloud-tasks-emulator-fix.patch

  2. self-assigned this
    on Jan 29, 2026
  3. jonathanedey commented on Jun 9, 2026

    @jonathanedey
    Contributor

    This is resolved in version 14.0.0. If you continue to encounter issues, please open a new issue with the relevant details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions