firebase-functions
firebase-functions copied to clipboard
functions.runWith 'memory' option onFinalize storage trigger deploys with default 256MB
Related issues
https://github.com/firebase/firebase-functions/issues/834 https://github.com/firebase/firebase-functions/pull/842
[REQUIRED] Version info
node: v14.18.1
firebase-functions: 3.18.0
firebase-tools: 10.1.5
firebase-admin: 10.0.2
[REQUIRED] Test case
import v8 = require('v8')
const appBucket = 'not-a-default-bucket'
export const storageTrigger = functions.runWith({
timeoutSeconds: 300,
memory: '4GB',
}).storage
.bucket(appBucket)
.object().onFinalize( (object) => {
functions.logger.log('memory allocation:', v8.getHeapStatistics())
})
[REQUIRED] Steps to reproduce
firebase deploy --only functions:storageTrigger
[REQUIRED] Expected behavior
Deploy function with 4GB of memory available. Function to run with 4GB allocated memory.
[REQUIRED] Actual behavior
Function runs with 256MB of allocated memory.
Were you able to successfully deploy your functions?
Yes, but it deployed with the incorrect memory allocation for running the function. No error or warning messages when deploying.
I've been using a workaround to manually set the runtime settings via the Google Cloud console. While the console will reflect the deployed runtime settings (4GB) following deployment, when the function is executed, it will only run with 256MB. To remedy, I manually edit (using the 4GB allocation setting already selected), save, and deploy the function from the console. The function will then run with the expected 4GB memory allocation.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
I'm seeing a similar issue with timeoutSeconds
. This is not a problem in firebase-functions v3.14.1, but is for v3.18.0
I am also having same problem.
Is this still happening in v11?
@MauriceArikoglu , not sure, I am at 10.x. But, that is a good suggestion -- upgrade and see if that fixes it
This was fixed and released in 10.3.0:
https://github.com/firebase/firebase-tools/commit/94b3156f033c7cab75001409b305edb29a26d688
Please feel free to re-open or create a new ticket if the problem persists.