firebase-tools: expose worker idle timeout options as per GCP emulator
Firebase functions currently timeout locally at 60 seconds, whereas this duration is configurable for remote executions.
GCP emulator provides the --idlePruneInterval and --maxIdle options for functions start, however these are currently not available from the firebase emulator cli.
see: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/issues/66 also see: https://stackoverflow.com/questions/47897400/update-firebase-emulator-function-timeout-duration
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 22 (10 by maintainers)
Commits related to this issue
- Add 9-minute timeout to emulated functions. Fixes #669 — committed to firebase/firebase-tools by remie 6 years ago
- Fix failing test on publishExtensionVersion (#669) — committed to firebase/firebase-tools by huangjeff5 4 years ago
I was talking about exposing timeout option in emulation, if you’re talking about in deploying functions, then yes we do have plans to expose this in the future.
The latest firebase CLI release (v3.17.7) now sets maxIdle to 9 minutes for all emulated functions, that should hopefully fulfill your needs since emulated functions will no longer be timing out. We chose 9 min since that’s the max timeout of deployed functions. We chose to simply set the timeout instead of making it configurable for an easier user experience, since there’s no harm to have a longer timeout than you need for emulated functions, you can always quit the process by Ctrl + C
Hi @joemanfoo, thanks for bringing this to our attention! I can confirm that we are seeing the 60s timeout instead of 540s like we are supposed to. We’ve filed an internal bug, and will be looking into this.
Thanks for getting back to me, @laurenzlong. It appears that I’m still getting timed out after 1 minute even after I run
npm i -g firebase-tools:Is the
.runWith(runtimeOptions)the appropriate way to indicate a longer execution time or should I be indicating this differently (e.g. a command line argument)?Thanks for your time!
I’m not sure that those are the right options to affect this particular timeout. There’s actually a separate
timeoutoption when one deploys a function, but currentlyfirebase-toolsdoesn’t set it.In addition, there’s currently a “functions proxy” timeout (also of 60s).
Both options should be set to a correct value to do the job. One can temporarily use
patch-packageto override them:After running
firebase serve, one can verify that the first option was applied correctly: