[ 
https://issues.apache.org/jira/browse/KNOX-3327?focusedWorklogId=1021203&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1021203
 ]

ASF GitHub Bot logged work on KNOX-3327:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 20/May/26 10:11
            Start Date: 20/May/26 10:11
    Worklog Time Spent: 10m 
      Work Description: smolnar82 opened a new pull request, #1235:
URL: https://github.com/apache/knox/pull/1235

   [KNOX-1234](https://issues.apache.org/jira/browse/KNOX-3327) -  Support 
periodic refresh of gateway configuration
   
   ## What changes were proposed in this pull request?
   
   This PR introduces the ability for the Knox Gateway to periodically refresh 
its configuration from a specific reloadable file (gateway-reloadable.xml). 
This allows administrators to modify certain gateway-level configurations at 
runtime
     without restarting the entire Gateway process.
   
     Key changes include:
      - Configuration Inclusion: Updated `GatewayConfigImpl` to include 
`gateway-reloadable.xml `in the prioritized list of configuration files.
      - Refresh Interval: Introduced` gateway.config.refresh.interval 
`(defaulting to 10,000ms) to control how often the gateway checks for updates.
      - Background Monitor: Added a scheduled executor in GatewayServer that 
monitors the modification timestamp of the reloadable configuration file and 
triggers a configuration reload if changes are detected.
      - SPI Updates: Added getConfigRefreshInterval() to the GatewayConfig 
interface.
   
   ## How was this patch tested?
   
     The patch was tested using new and updated automated unit tests:
   
      1. `GatewayConfigImplTest.testGetConfigRefreshInterval`: Verified that 
the refresh interval configuration is correctly parsed.
      2. `GatewayConfigImplTest.testReloadableConfigLoading`: Verified that 
properties defined in `gateway-reloadable.xml` are correctly loaded into the 
configuration object upon initialization.
      3. `GatewayServerTest.testRefreshGatewayConfig`: Verified the logic that 
monitors file timestamps. Confirmed that:
          - An initial reload is triggered on first check.
          - Subsequent checks do not trigger a reload if the file hasn't 
changed.
          - Updating the file modification time correctly triggers a new reload.
   
    Steps to run tests:
     `mvn test -Dtest=GatewayConfigImplTest,GatewayServerTest -pl 
gateway-server`
   
   ## Integration Tests
     Unit tests were added to gateway-server to cover the new functionality. 
These tests use TemporaryFolder and manual XML generation to simulate file 
system changes and verify the reload behavior.
   
   
   ## UI changes
   N/A




Issue Time Tracking
-------------------

            Worklog Id:     (was: 1021203)
    Remaining Estimate: 0h
            Time Spent: 10m

> Support dynamic gateway config refresh
> --------------------------------------
>
>                 Key: KNOX-3327
>                 URL: https://issues.apache.org/jira/browse/KNOX-3327
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 3.0.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> This improvement would allow clients to update a pre-configured file called 
> {{gateway-reloadable.xml }}located in Knox's {{CONF_DIR}} which Knox would 
> pickup and refresh its own config, if needed (in case there were changes).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to