smolnar82 opened a new pull request #324: URL: https://github.com/apache/knox/pull/324
## What changes were proposed in this pull request? Surrounding the CM configuration check logic with a `try/catch` block and logging if any issue occurred during the operation. ## How was this patch tested? Manually tested: 1. deployed Knox w/o the in #319 and deployed a descriptor pointing to a CM cluster where I made a configuration change in one the services 2. waited until CM configuration change monitoring occurred 3. as expected, the monitoring failed. This time the monitoring thread did not get suspended and the appropriate log message was shown: ``` 2020-04-21 15:38:00,270 DEBUG discovery.cm (PollingConfigurationAnalyzer.java:run(169)) - Checking Cluster 1 @ http://$CM_HOST:7180 for configuration changes... 2020-04-21 15:38:00,274 DEBUG discovery.cm (PollingConfigurationAnalyzer.java:getRelevantEvents(373)) - Querying restart events from Cluster 1 @ http://$CM_HOST:7180 since 2020-04-21T13:37:00.010Z 2020-04-21 15:38:45,440 ERROR discovery.cm (PollingConfigurationAnalyzer.java:run(201)) - Error while monitoring ClouderaManager configuration changes: java.lang.NullPointerException java.lang.NullPointerException at org.apache.knox.gateway.topology.discovery.cm.monitor.PollingConfigurationAnalyzer.isRelevantEvent(PollingConfigurationAnalyzer.java:398) at org.apache.knox.gateway.topology.discovery.cm.monitor.PollingConfigurationAnalyzer.getRelevantEvents(PollingConfigurationAnalyzer.java:383) at org.apache.knox.gateway.topology.discovery.cm.monitor.PollingConfigurationAnalyzer.run(PollingConfigurationAnalyzer.java:180) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
