Skip to content

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

@ejizba

Description

@ejizba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions