firebase-tools: Functions emulator does not honor timeoutSeconds
[REQUIRED] Environment info
firebase-tools: 8.16.2
Platform: macOS 10.15.7
[REQUIRED] Test case
exports.zip = functions
.runWith({ memory: '1GB', timeoutSeconds: 540 })
.https
.onRequest(zip);
[REQUIRED] Steps to reproduce
Run function on emulator such that it takes a long time to execute.
[REQUIRED] Expected behavior
I expect that the function times out in 540 seconds.
[REQUIRED] Actual behavior
The function times out in about 60 seconds (I did not time it, that is a guess).
Is it a known issue that the emulator doesn’t respect timeoutSeconds
, or did I do it wrong?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 31 (9 by maintainers)
Yeah, it’s an undocumented breaking change on v10.2.0
Looks like setting env
FUNCTIONS_EMULATOR_TIMEOUT_SECONDS=540s
is a workaround for the dropped featureIt can be added on a .env.local file on the functions folder to be used only on emulator
Firebase CLI v11.4.0 should now support timeout on your function configuration - no need to setup
FUNCTIONS_EMULATOR_TIMEOUT_SECONDS
environment variable.any updates on this one? anyone knows if there is a plan to fix this soon?
@samtstern could this be reopened? I, along with others, are still experiencing this issue.
I can confirm that @volkyeth’s workaround works.
Here’s a workaround I’ve just found while reading through the
functionsEmulatorRuntime.js
file:i having this issue as well after i upgraded to node 16
@xaphod ah ok!
--inspect-functions
should disable timeout behavior completely because we didn’t want people hitting timeouts while they have execution paused on a breakpoint. So maybe that’s not working?Same issue is happening over here, I’m using firebase-tools 11.0.0.
same issue here, running firebase-tools 10.2+. Also confirm the @volkyeth workaround using the env var is working well 🙏
Also experiencing this from
v1.2.0
onwards Reverting tov10.1.5
solves it@nadermjaber had the solution that finally worked for me. package.json: “firebase-admin”: “^12.0.0”, “firebase-functions”: “^4.7.0”, “node”: “18”
globally: “firebase-tools”: 13.2.1 “node”: 20 (This is being used, I wonder if it’s the issue?)
adding the --inspect-functions flag when I started the emulator finally got it working
The only way I can get the function to work locally is with the --inspect-functions flag. I wonder if its because this function uses node 20.