Skip to content

KNOX-3327: Support periodic refresh of gateway configuration#1235

Merged
smolnar82 merged 2 commits into
apache:masterfrom
smolnar82:KNOX-3327
May 20, 2026
Merged

KNOX-3327: Support periodic refresh of gateway configuration#1235
smolnar82 merged 2 commits into
apache:masterfrom
smolnar82:KNOX-3327

Conversation

@smolnar82
Copy link
Copy Markdown
Contributor

KNOX-1234 - 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: Introducedgateway.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

@smolnar82 smolnar82 requested a review from hanicz May 20, 2026 10:11
@smolnar82 smolnar82 self-assigned this May 20, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

Test Results

21 tests   21 ✅  1s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit e21de9c.

♻️ This comment has been updated with latest results.

@smolnar82 smolnar82 merged commit d4eecad into apache:master May 20, 2026
3 of 4 checks passed
@smolnar82 smolnar82 deleted the KNOX-3327 branch May 20, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants