Files
Nathan Whitaker 19c25e298a fix(os): serialize process environment updates (#36074)
## 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
2026-08-10 12:22:10 -07:00
..
2026-01-08 16:28:43 +01:00
2026-01-08 16:28:43 +01:00
2026-01-08 16:28:43 +01:00