SERVER-873
, but that issue was closed as won't fix (I'm not sure why). Possibly wasn't considered a high enough priority? Maksym Melnychok sorry for the delay responding - do you have specific performance concerns (perhaps data?) indicating the severity of this issue?
I think there is a conflicting requirement that environment should react to changes - but not sure. It makes a lot of sense to not reread environment.conf during a compilation. All the code around environment config is overly complicated as it integrates with settings.
When running with environment_timeout=unlimited I see 3 stats for environment.conf when the environment is created. I think these correspond to modulepath, rich_data and static_catalogs. But those values are cached in the Environment object, so the file is not accessed for subsequent compilations.
That said PUP-8014 and shorter lived environments could make this issue worse.
Now that environment caching works as expected, it would be good to fix this issue, as the current system loads environments and their configs through different code paths, which greatly complicates the puppet code base.