Skip to content

Emulator 60s function timeout #9754

@EthanSK

Description

@EthanSK

[REQUIRED] Environment info

firebase-tools: 15.1.0

Platform: macOS 15.7 (Sequoia), arm64 (Apple Silicon M1 Pro)

[REQUIRED] Test case

Cloud Functions configured with timeoutSeconds: 540 (9 minutes) are being killed by the Firebase Emulator at exactly 60 seconds, ignoring the configured timeout.

// Example function configuration
export const renderClipPreviewVideo = onCall(
  {
    timeoutSeconds: 540,
    memory: '4GiB',
    region: 'us-central1',
  },
  async (request) => {
    // Long-running video rendering operation
  },
);

firebase.json emulator configuration:

{
  "emulators": {
    "functions": {
      "host": "0.0.0.0",
      "port": 5001
    },
    "firestore": {
      "host": "0.0.0.0",
      "port": 8080
    },
    "storage": {
      "host": "0.0.0.0",
      "port": 9199
    }
  }
}

[REQUIRED] Steps to reproduce

  1. Create a Cloud Function with timeoutSeconds set to any value > 60 seconds (e.g., 540)
  2. Start the Firebase emulators: firebase emulators:start --only functions,firestore,storage
  3. Call the function and have it perform an operation that takes longer than 60 seconds
  4. Observe the function being killed at exactly 60 seconds with "socket hang up" error

Environment variable workaround attempted (did not work):

export FUNCTIONS_EMULATOR_TIMEOUT_SECONDS=540

[REQUIRED] Expected behavior

The Firebase Functions Emulator should respect the timeoutSeconds configuration specified in the function definition (e.g., 540 seconds), allowing long-running operations to complete within the configured timeout.

[REQUIRED] Actual behavior

The emulator ignores the timeoutSeconds configuration and enforces a hard 60-second timeout. Functions that exceed 60 seconds are killed with the following errors:

⚠  Your function was killed because it raised an unhandled error.
i  Request to function failed: Error: socket hang up

The function is terminated abruptly regardless of:

  • The timeoutSeconds value in the function configuration
  • The FUNCTIONS_EMULATOR_TIMEOUT_SECONDS environment variable
  • Any other configuration attempts

This prevents local development and testing of any function that legitimately needs more than 60 seconds to complete (e.g., video processing, large file operations, AI model inference).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions