workerd icon indicating copy to clipboard operation
workerd copied to clipboard

FIX SHOULD_GATE_ENTROPY condition

Open hoodmane opened this issue 1 year ago • 2 comments

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.

hoodmane avatar Sep 06 '24 13:09 hoodmane

Thanks @danlapid. I added Dominik who reported the bugs this fixes.

hoodmane avatar Sep 06 '24 13:09 hoodmane

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.py is the main module in the worker)

This PR fixes those. Thanks @hoodmane!

dom96 avatar Sep 06 '24 14:09 dom96