[
https://issues.apache.org/jira/browse/KNOX-3511?focusedWorklogId=1046980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1046980
]
ASF GitHub Bot logged work on KNOX-3511:
----------------------------------------
Author: ASF GitHub Bot
Created on: 12/Oct/26 11:42
Start Date: 12/Oct/26 11:42
Worklog Time Spent: 10m
Work Description: hanicz opened a new pull request, #1450:
URL: https://github.com/apache/knox/pull/1450
… exist at startup
(It is very **important** that you created an Apache Knox JIRA for this
change and that the PR title/commit message includes the Apache Knox JIRA ID!)
[KNOX-3511](https://issues.apache.org/jira/browse/KNOX-3511) - Gateway
ignores gateway-reloadable.xml if the file did not exist at startup
## What changes were proposed in this pull request?
- `GatewayConfigImpl.java`: the config now keeps a list of the files it read
at startup. A new method, `addConfigFileIfAbsent(File)`, adds a file to that
list if it exists and isn't there yet; otherwise it does nothing. It logs the
same Loading configuration file ... line as at startup.
- `GatewayServer.refreshGatewayConfig`: calls that method just before
`reloadConfiguration()`. So the first refresh after the file appears adds it,
and the reload then actually reads it before the listeners are told.
## How was this patch tested?
Unit tests, tested locally with missing gateway-reloadable, tested
modification, tested with present file and modification
Issue Time Tracking
-------------------
Worklog Id: (was: 1046980)
Remaining Estimate: 0h
Time Spent: 10m
> Gateway ignores gateway-reloadable.xml if the file did not exist at startup
> ---------------------------------------------------------------------------
>
> Key: KNOX-3511
> URL: https://issues.apache.org/jira/browse/KNOX-3511
> Project: Apache Knox
> Issue Type: Bug
> Components: Server
> Affects Versions: 3.1.0
> Reporter: Tamás Hanicz
> Assignee: Tamás Hanicz
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Description:
> GatewayConfigImpl registers gateway-reloadable.xml as a configuration
> resource only if the file exists when the gateway starts (loadConfigFile
> checks f.exists() before addResource). The refresh loop in
> GatewayServer.refreshGatewayConfig still notices when the file is created
> later, calls reloadConfiguration(), logs "Refreshed gateway config" and
> notifies every GatewayConfigChangeListener. But reloadConfiguration()
> re-reads only the resources registered at startup, so none of the new file's
> properties take effect. For example, gateway.ldap.enabled=true leaves
> isLDAPEnabled() false and the embedded LDAP never starts. Nothing logs a
> warning or error. Later edits to the file are ignored too, until the gateway
> restarts.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)