workerd
workerd copied to clipboard
FIX SHOULD_GATE_ENTROPY condition
We can't turn it off if IS_TRACING because it needs to have the same setting when creating a snapshot as when using it.
Thanks @danlapid. I added Dominik who reported the bugs this fixes.
For context, while testing package memory snapshots I ran into two issues:
- when tracing is enabled, which it is every time you use crossbow, the entropy code crashes the worker with "Cannot use random.seed() outside of request context"
- invalidating caches was only done for baseline snapshots, so they weren't properly invalidated for package snapshots which lead to errors like "ModuleNotFoundError: No module named 'index'" (where
index.pyis the main module in the worker)
This PR fixes those. Thanks @hoodmane!