[
https://issues.apache.org/jira/browse/KNOX-2891?focusedWorklogId=852232&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-852232
]
ASF GitHub Bot logged work on KNOX-2891:
----------------------------------------
Author: ASF GitHub Bot
Created on: 22/Mar/23 11:31
Start Date: 22/Mar/23 11:31
Worklog Time Spent: 10m
Work Description: zeroflag opened a new pull request, #743:
URL: https://github.com/apache/knox/pull/743
## What changes were proposed in this pull request?
There is an ordering issue between the topology server + hadoop xml resource
monitor. The topology service is started first, and it'll immediately trigger
an onChange event on all descriptors. Hadoop xml resource monitor will create
the providers afterwards so it can happen that even the provider is available
(in the hxr) the file is not yet generated therefore the topology won't be
generated due to the missing provider.
## How was this patch tested?
1. Created a descriptor with a non existing provider
```
sample_topology2
providerConfigRef=testProviders2##WEBHDFS:url=https://dummy:7189
```
2. Restarteed kox
3. Observed the unresolved provider reference message in the log
```bash
[root@amagyar-1 ~]# grep "Unresolved provider configuration reference"
/var/log/knox/gateway/gateway.log | wc -l
1
```
4. Added the missing provider
```
providerConfigs:testProviders2
role=authentication#authentication.name=ShiroProvider
```
5. Restarted knox
6. No new unresolved provider reference message, just the old one
```bash
[root@amagyar-1 ~]# grep "Unresolved provider configuration reference"
/var/log/knox/gateway/gateway.log | wc -l
1
```
7. Both topology + provider were generateed.
```bash
/var/lib/knox/gateway/conf/topologies/sample_topology2.xml
/var/lib/knox/gateway/conf/shared-providers/testProviders2.json
````
Issue Time Tracking
-------------------
Worklog Id: (was: 852232)
Remaining Estimate: 0h
Time Spent: 10m
> Topology is not deployed if the referred provider file is not available
> initially and recreated later
> -----------------------------------------------------------------------------------------------------
>
> Key: KNOX-2891
> URL: https://issues.apache.org/jira/browse/KNOX-2891
> Project: Apache Knox
> Issue Type: Bug
> Reporter: J.Andreina
> Assignee: Attila Magyar
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Steps:
> 1. Create descriptor in conf/cdp-resources.xml when reference provider not
> available
> name=sample_topology2
> value= providerConfigRef=testProviders2##WEBHDFS:url=https://dummy:7189
> 2. restart knox (sample_topology2 will not get deployed as testProviders2
> does not exist which is expected behaviour)
> 3. Create provider with name testProviders2
> providerConfigs:testProviders2
> role=authentication#authentication.name=ShiroProvider
> 4. restart knox
> Issue:
> sample_topology2 is not getting deployed due to same reason that
> testProvider2 is not available.
> On third restart sample_topology2 got deployed as during second restart
> testProviders2 got deployed
--
This message was sent by Atlassian Jira
(v8.20.10#820010)