Repository navigation
Hot-reload configurations in application.conf - #2245
Merged
Merged
Conversation
shengquan-ni
requested review from
Xiao-zhen-Liu,
Yicong-Huang and
aglinxinyuan
December 3, 2023 01:38
Xiao-zhen-Liu
pushed a commit
that referenced
this pull request
Jan 16, 2024
## Hot-reloading of configurations This PR refactors the old Constants global object where we store all the configuration as static variables. Now all configurations are defined as methods and will trigger a file modification check. If the `application.conf` is modified, the updated file will be parsed and new values of configurations will be retrieved. ### Refactoring of Constants This PR removes the old Constants object and creates a new global object called AmberConfig. All configurations are retrieved by this object. The developer is not allowed to retrieve the values directly from `application.conf` with the string path such as `flow-control.max-credit-allowed-in-bytes-per-channel`. This enforces all configurations are retrieved with the hot-reload mechanism. ### Lazy reloading of configuration file The AmberConfig object maintains the last modified timestamp of `application.conf` and checks if the timestamp remains the same each time a configuration is retrieved. If not, it re-loads the configuration, otherwise, it retrieves the value from a cached copy. **IMPORTANT NOTE: For safety, this hot-reload feature now only works on the following configurations:** - flow-control.max-credit-allowed-in-bytes-per-channel - network-buffering.default-batch-size For other configurations, we can revisit hot-reload when needed.
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
## Hot-reloading of configurations This PR refactors the old Constants global object where we store all the configuration as static variables. Now all configurations are defined as methods and will trigger a file modification check. If the `application.conf` is modified, the updated file will be parsed and new values of configurations will be retrieved. ### Refactoring of Constants This PR removes the old Constants object and creates a new global object called AmberConfig. All configurations are retrieved by this object. The developer is not allowed to retrieve the values directly from `application.conf` with the string path such as `flow-control.max-credit-allowed-in-bytes-per-channel`. This enforces all configurations are retrieved with the hot-reload mechanism. ### Lazy reloading of configuration file The AmberConfig object maintains the last modified timestamp of `application.conf` and checks if the timestamp remains the same each time a configuration is retrieved. If not, it re-loads the configuration, otherwise, it retrieves the value from a cached copy. **IMPORTANT NOTE: For safety, this hot-reload feature now only works on the following configurations:** - flow-control.max-credit-allowed-in-bytes-per-channel - network-buffering.default-batch-size For other configurations, we can revisit hot-reload when needed.
This was referenced Oct 19, 2026
renovate-bot
pushed a commit
to renovate-bot/apache-_-texera
that referenced
this pull request
Oct 24, 2026
### What changes were proposed in this PR? Removes the `AmberConfig` object, whose only member, `masterNodeAddr`, is written but never read. **+8/−57 lines.** There is no behaviour change. - **`AmberConfig.scala`:** deleted. - **`AmberRuntime.scala`:** the two `AmberConfig.masterNodeAddr = createMasterAddress(...)` writes in `startActorMaster` / `startActorWorker`, the private `createMasterAddress` helper that only fed them, and the `Address` import. The seed nodes, hostname and actor system the two methods build are unchanged. - **`ScheduleGenerator.scala`:** a ScalaDoc line cited `AmberConfig.maxConcurrentRegions`; the value lives in `ApplicationConfig`. - **`AmberRuntimeSpec`:** drops the save/restore of the global, the sentinel, and the one case that only observed `masterNodeAddr`. Every case covering the surviving `AmberRuntime` behaviour stays. ### History | | | | --- | --- | | **Introduced by** | apache#811 (2020-08-22), "Merge Amber master into texera master": `masterNodeAddr`, for `ClusterListener` to tell the master node apart. apache#1439 (2022-02-12) added `createMasterAddress`, and apache#2245 (2023-12-06) moved the field into `AmberConfig` | | **Usage removed by** | apache#3029 (2024-12-08), "Create a separate web server for workflow execution". It deleted the last reader, `member.address != AmberConfig.masterNodeAddr` in `ClusterListener`. apache#3466 (2025-06-13) then moved every other `AmberConfig` member to `common/config`, leaving only this field | It has been write-only for nearly two years. ### Any related issues, documentation, discussions? Closes apache#9025 ### How was this PR tested? No new tests. `AmberRuntimeSpec` keeps its coverage of the master and worker startup paths. Locally, from the repo root with Java 17: - `sbt "WorkflowExecutionService/Test/compile" "WorkflowExecutionService/scalafmtCheckAll" "WorkflowExecutionService/scalafixAll --check"`: success. - `sbt "WorkflowExecutionService/testOnly *AmberRuntimeSpec *ComputingUnitMasterSpec *ClusterListenerSpec *CostBasedScheduleGeneratorSpec"`: 4 suites, 68 tests, all pass. To re-check: ``` git grep -n -w -e AmberConfig -e masterNodeAddr -e createMasterAddress -- amber # no hits ``` ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hot-reloading of configurations
This PR refactors the old Constants global object where we store all the configuration as static variables. Now all configurations are defined as methods and will trigger a file modification check. If the
application.confis modified, the updated file will be parsed and new values of configurations will be retrieved.Refactoring of Constants
This PR removes the old Constants object and creates a new global object called AmberConfig. All configurations are retrieved by this object. The developer is not allowed to retrieve the values directly from
application.confwith the string path such asflow-control.max-credit-allowed-in-bytes-per-channel. This enforces all configurations are retrieved with the hot-reload mechanism.Lazy reloading of configuration file
The AmberConfig object maintains the last modified timestamp of
application.confand checks if the timestamp remains the same each time a configuration is retrieved. If not, it re-loads the configuration, otherwise, it retrieves the value from a cached copy.IMPORTANT NOTE: For safety, this hot-reload feature now only works on the following configurations:
For other configurations, we can revisit hot-reload when needed.