mirror of
https://github.com/aphrody-labs/deno.git
synced 2026-10-14 06:19:28 +00:00
## Summary - coordinate runtime process-environment access with a shared guard - keep `TZ` mutation, native timezone refresh, and V8 timezone redetection in one critical section - use the same coordination for Node dotenv loading and watched dotenv reloads - cover `TZ` deletion and `process.loadEnvFile()` timezone updates ## Details Process-environment updates can originate from multiple runtime workers. `TZ` changes also refresh native and V8 timezone state, but those stages were not coordinated as one operation, so another environment update could overlap the refresh. This adds a guard for the runtime environment paths and keeps it held through the complete timezone update. The guard is also used by Node dotenv loading and watched dotenv reloads so those paths follow the same ordering. ## Validation - `./tools/format.js` - `cargo check -p deno_os -p deno_node` - `cargo check -p deno` - `cargo test -p deno_os process_env_lock_is_held_through_timezone_notification` - `cargo build --bin deno --bin test_server` - `cargo test -p specs_tests --test specs -- run::tz_env` - `cargo test -p specs_tests --test specs -- run::process_env_load::env_load_file_updates_timezone` - bounded eight-worker environment and timezone update stress