> On Sept. 15, 2016, 12:18 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/HostRoleCommandEntity.java,
> >  lines 531-533
> > <https://reviews.apache.org/r/51917/diff/1/?file=1498920#file1498920line531>
> >
> >     Is it ever possible to have a stage that does not yet have a request?  
> > I would hope not.

Probably not, no - I could have just done a refresh on every HRCEntity ... but 
I felt that might have been overkill here since the problem is just that the ID 
isn't populated since the association was set by the entity. I suppose you 
could still run into problems if you associate the StageEntity with the 
HRCENtity before persisting the StageEntity. 

Should we just do a refresh?


- Jonathan


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


On Sept. 15, 2016, 12:15 p.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/51917/
> -----------------------------------------------------------
> 
> (Updated Sept. 15, 2016, 12:15 p.m.)
> 
> 
> 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