zeroflag opened a new pull request, #783:
URL: https://github.com/apache/knox/pull/783
## What changes were proposed in this pull request?
Validating if shared provider is used by a descriptor before deleting it via
hadoop xml resource monitor.
## How was this patch tested?
Enabling monitor:
```xml
<property>
<name>gateway.cloudera.manager.descriptors.monitor.interval</name>
<value>5000</value>
</property>
```
hxr file
```xml
<configuration>
<property>
<name>topology3</name>
<value>
discoveryType=ClouderaManager#
discoveryAddress=http://host:123#
discoveryUser=user#
discoveryPasswordAlias=alias#
cluster=Cluster 1#
providerConfigRef=used#
app:knoxauth:param1.name=param1.value#
app:admin-ui#
HIVE:url=http://localhost:456#
HIVE:version=1.0#
HIVE:httpclient.connectionTimeout=5m#
HIVE:httpclient.socketTimeout=100m
</value>
</property>
<property>
<name>providerConfigs:used,unused</name>
<value>remove</value>
</property>
</configuration>
```
Observed log messages:
```
2023-08-14 13:08:50,085 WARN knox.gateway
(HadoopXmlResourceParserResult.java:check(54)) - Not deleting provider used as
it is referenced by on ore more descriptors.
2023-08-14 13:08:50,111 INFO knox.gateway
(HadoopXmlResourceMonitor.java:processDeleted(120)) - Deleting file
/Users/attilamagyar/development/test/conf/shared-providers/unused.json
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]