Skip to content
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

Worker init and func env reload pointing to the same app fails to register functions #737

Open
ejizba opened this issue Mar 29, 2024 · 1 comment
Labels
Milestone

Comments

@ejizba
Copy link
Contributor

ejizba commented Mar 29, 2024

Created for this incident (internal-only link). This appears to be a rare edge case. For this particular app, it only happened once in the last 90 days.

Normally we get either a worker init request or a func env reload request pointing to the user's app. However, in this incident we got both pointing to the same app. I don't think that should happen, so I filed this issue on the host, but we might be able to handle this on our side. The problem is that Node.js caches modules when you load them. We load the user's code for the worker init request, but we clear our own caches (including the functions that have been registered) when we do the func env reload. But when we try to re-load the user's code, it doesn't actually re-execute that code because of Node.js's module cache and no functions get registered. We would have to somehow clear Node.js's module cache at the same time we clear our own caches to fix this.

@retail-robot
Copy link

retail-robot commented Aug 16, 2024

I've been seeing weird behavior like this in both my local environment and in the azure environment quite a bit recently. I'm actually experiencing this sort of issue right now - very persistently. Not exactly sure if it's this, but it sure seems like it could be. The behavior is persisting across restarts, and I don't think require.cache is being cached anywhere itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants