----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/50753/#review144920 -----------------------------------------------------------
Ship it! This is an AmbariEvent which has it's own EventBus; however the bus is an asynchronous, single-threaded bus. This means that it's possible for a heartbeat to be received in between when this event is broadcast and when it's received by your subscriber method. If the problem only happens on registration, I think this solution is OK. But if a heartbeat from an agent can cause problems as well, then there is still a slight chance that the timing here could still reproduce the bug. - Jonathan Hurley On Aug. 4, 2016, 11:22 a.m., Laszlo Puskas wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/50753/ > ----------------------------------------------------------- > > (Updated Aug. 4, 2016, 11:22 a.m.) > > > Review request for Ambari, Jonathan Hurley, Robert Nettleton, Sandor Magyari, > and Sebastian Toader. > > > Bugs: AMBARI-18005 > https://issues.apache.org/jira/browse/AMBARI-18005 > > > Repository: ambari > > > Description > ------- > > When a host is removed from the cluster and later from ambari there's a > chance the agent registers back to the ambari server before the agent is > stopped. > Stopping the machine running the agent without the host being deleted again > leads to an inconsistent state in the ambari-server due to cached state. > Resolution: > The cached resources get cleared on host delete event. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java > a757010 > > ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java > 0190478 > > Diff: https://reviews.apache.org/r/50753/diff/ > > > Testing > ------- > > Suceesfully tested. (Manually) > Unit tests in progress. > > > Thanks, > > Laszlo Puskas > >