zeroflag opened a new pull request, #811:
URL: https://github.com/apache/knox/pull/811
## What changes were proposed in this pull request?
When a config change is detected by the Polling Config Analyzer then then
the cache used by the service discovery will be cleared. If this happens when
discovery is in progress then a NullPointerException will happen.
```java
private ServiceDetails getServiceDetails(ServiceDiscoveryConfig
serviceDiscoveryConfig, ApiService service) {
return getClusterServices(serviceDiscoveryConfig).getIfPresent(service);
// <= NPE
}
```
```java
@Override
public void onConfigurationChange(String source, String clusterName) {
log.clearServiceDiscoveryRepository();
repository.clear(); // this will cause the NPE
}
```
This was observed on a live cluster when certain cluster properties was
changed during knox startup.
## How was this patch tested?
- unit test
--
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]