[ 
https://issues.apache.org/jira/browse/KNOX-2350?focusedWorklogId=425672&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-425672
 ]

ASF GitHub Bot logged work on KNOX-2350:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Apr/20 12:17
            Start Date: 21/Apr/20 12:17
    Worklog Time Spent: 10m 
      Work Description: smolnar82 opened a new pull request #318:
URL: https://github.com/apache/knox/pull/318


   ## What changes were proposed in this pull request?
   
   Checking if the given CM event has either `COMMAND` or `COMMAND_STATUS` 
attribute before calling `.get(0)` on the attribute map entry (which is `null` 
if the above condition is not true).
   
   ## How was this patch tested?
   
   Updated and ran JUnit tests as well as executing the following manual test 
steps in a cluster with 2 Knox instances with CM configuration monitoring 
enabled:
   - redeployed Knox with my changes in place
   - changed Atlas's HTTPS server port from 31445 to 31446 and restarted Atlas
   - confirmed that CM configuration monitor picked up the change (in both Knox 
instances) and re-deployed the affected topologies:
   
   ```
   2020-04-20 22:11:49,606 DEBUG discovery.cm 
(PollingConfigurationAnalyzer.java:run(171)) - Checking Cluster 1 @ 
https://$CM_HOST:7183 for configuration changes...
   2020-04-20 22:11:49,615 DEBUG discovery.cm 
(PollingConfigurationAnalyzer.java:getRelevantEvents(371)) - Querying restart 
events from Cluster 1 @ https://$CM_HOST:7183 since 2020-04-20T22:10:49.529213Z
   2020-04-20 22:11:49,686 DEBUG discovery.cm 
(PollingConfigurationAnalyzer.java:getCurrentServiceConfiguration(455)) - 
Getting current configuration for ATLAS-1 from Cluster 1 @ https://$CM_HOST:7183
   2020-04-20 22:11:49,899 DEBUG discovery.cm 
(PollingConfigurationAnalyzer.java:run(211)) - Analyzing current ATLAS-1 
configuration for changes...
   2020-04-20 22:11:49,899 INFO  discovery.cm 
(PollingConfigurationAnalyzer.java:hasConfigurationChanged(524)) - Role 
property atlas_server_https_port value has changed from 31445 to 31446
   2020-04-20 22:11:49,899 INFO  knox.gateway 
(DefaultTopologyService.java:onConfigurationChange(968)) - A cluster 
configuration change was noticed for Cluster 1 @ https://$CM_HOST:7183
   2020-04-20 22:11:49,905 INFO  knox.gateway 
(DefaultTopologyService.java:onConfigurationChange(976)) - Triggering topology 
regeneration for descriptor 
/var/lib/knox/gateway/conf/descriptors/cdp-proxy-api.json because of change to 
the Cluster 1 @ https://$CM_HOST:7183 configuration.
   2020-04-20 22:11:49,917 INFO  knox.gateway 
(DefaultTopologyService.java:onConfigurationChange(976)) - Triggering topology 
regeneration for descriptor 
/var/lib/knox/gateway/conf/descriptors/cdp-proxy.json because of change to the 
Cluster 1 @ https://$CM_HOST:7183 configuration.
   ```


----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 425672)
    Remaining Estimate: 0h
            Time Spent: 10m

> Make sure CM configuration monitor handles event w/o COMMAND and/or 
> COMMAND_STATUS attributes
> ---------------------------------------------------------------------------------------------
>
>                 Key: KNOX-2350
>                 URL: https://issues.apache.org/jira/browse/KNOX-2350
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: cm-discovery
>    Affects Versions: 1.4.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.5.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In case {{PollingConfigurationAnalyzer}} receives an event from CM which has 
> no {{COMMAND}} and/or {{COMMAND_STATUS}} attribute(s) a 
> {{NullPointerException}} is thrown in 
> {{org.apache.knox.gateway.topology.discovery.cm.monitor.PollingConfigurationAnalyzer.isRelevantEvent(ApiEvent)}}
>  which makes the entire configuration monitor thread suspended.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to