-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/51917/
-----------------------------------------------------------

Review request for Ambari, Alejandro Fernandez, Nate Cole, and Robert Levas.


Bugs: AMBARI-18404
    https://issues.apache.org/jira/browse/AMBARI-18404


Repository: ambari


Description
-------

When creating an upgrade, the {{upgrades_summary}} endpoint sometimes returns a 
NPE. 

STR:
- Start an upgrade
- Force an error (remove {{hdp-select}})
- Wait for error in upgrade, and then make a request to {{upgrades_summary}}

```
HostRoleCommandEntity mostRecentFailure = 
s_hostRoleCommandDAO.findMostRecentFailure(upgradeRequestId);
```
And its requestId is null

This is because the entities are created with associations and never refreshed 
from the database. We could have done a DAO.refresh() on each HRC as well, but 
that might have been overkill for this problem since we have the IDs to begin 
with.


Diffs
-----

  
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessorImpl.java
 b7e7f2d 
  
ambari-server/src/main/java/org/apache/ambari/server/actionmanager/HostRoleCommand.java
 ff2ce92 
  
ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java
 6288091 
  
ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java 
c3b44b8 
  
ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionDBAccessorImpl.java
 0813dff 

Diff: https://reviews.apache.org/r/51917/diff/


Testing
-------

mvn clean test


Thanks,

Jonathan Hurley

Reply via email to