use macro with cache to load env#6618
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4bbb9bca3d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return Ok(None); | ||
| } | ||
| if !quickwit_common::get_bool_from_env("QW_ENABLE_DATAFUSION_ENDPOINT", false) { | ||
| if !quickwit_common::get_bool_from_env_cached!("QW_ENABLE_DATAFUSION_ENDPOINT", false) { |
There was a problem hiding this comment.
Don't cache the DataFusion enable flag globally
When the datafusion feature is tested in-process, many ClusterSandboxBuilder::build_and_start* tests can start a searcher before metrics_distributed_tests sets QW_ENABLE_DATAFUSION_ENDPOINT=true; this new OnceLock then caches false for the whole test process, so the later DataFusion sandbox never mounts the gRPC service and its client calls fail. This toggle should remain evaluated at node startup (or be made explicitly test-scoped) rather than using a process-wide cached read.
Useful? React with 👍 / 👎.
switch more usage to
get_from_env_cachedto enforce they are read (and logged) only once