Skip to content

functions.runWith 'memory' option onFinalize storage trigger deploys with default 256MB #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BenLLong opened this issue Feb 17, 2022 · 6 comments
Assignees

Comments

@BenLLong
Copy link

Related issues

#834
#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.

@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@opdich
Copy link

opdich commented Feb 17, 2022

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

@taeold taeold self-assigned this Feb 23, 2022
@joelstevick
Copy link

I am also having same problem.

@MauriceArikoglu
Copy link

Is this still happening in v11?

@joelstevick
Copy link

@MauriceArikoglu , not sure, I am at 10.x. But, that is a good suggestion -- upgrade and see if that fixes it

@taeold
Copy link
Contributor

taeold commented Dec 13, 2022

This was fixed and released in 10.3.0:

firebase/firebase-tools@94b3156

Please feel free to re-open or create a new ticket if the problem persists.

@taeold taeold closed this as completed Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants