-
Notifications
You must be signed in to change notification settings - Fork 45
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
Node process is making calls to Azure Files for package.json during cold start #449
Comments
I am wondering if node tries to find package.json on the function code load: |
I think this is standard behavior for Node. It uses package.json to figure out things like module system type (commonjs or module) and it'll search all parents to find it. It's searching from that location because workers\node\dist\srcnodejsWorker.js is the entry point. Not sure if we can prevent this but can probably limit it to a single read if we include a package.json in workers\node\dist\src. |
To prove the theory I did not load function from file system but instead loaded hardcoded function from memory. It looks like we need some "empty" package.json added to the worker so it will be loaded from worker folder before going to AzureFiles: @safihamid validated that it works: |
|
Fixed in #501 |
Cold Start profiles show calls directly to Azure files to try to read package.json file during specialization.
This happens even when content is deployed az zip and we are using zip cache.
Looks like node process looks at all these places to try to load the package.json file:
The text was updated successfully, but these errors were encountered: