Re: Review Request 61781: Cache hashes should not be reset after restart ; some ambari-server restart fixes

2017-08-22 Thread Andrew Onischuk


> On Aug. 22, 2017, 8:37 a.m., Attila Doroszlai wrote:
> > ambari-agent/src/main/python/ambari_agent/ClusterCache.py
> > Lines 57-62 (original), 58-68 (patched)
> > 
> >
> > It is possible to have a writer write out cache contents between 
> > reading the json and hash files.  To prevent this, both reads should be 
> > guarded by the same acquisition of `__file_lock`, ie. move `with 
> > self.__file_lock` to the outermost level, the same way as it is in 
> > `persist_cache`.

Agreed. Thanks.


- Andrew


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


On Aug. 22, 2017, 10:34 a.m., Andrew Onischuk wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61781/
> ---
> 
> (Updated Aug. 22, 2017, 10:34 a.m.)
> 
> 
> Review request for Ambari, Attila Doroszlai, Dmytro Sen, Myroslav 
> Papirkovskyy, and Sid Wagle.
> 
> 
> Bugs: AMBARI-21763
> https://issues.apache.org/jira/browse/AMBARI-21763
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> .
> 
> 
> Diffs
> -
> 
>   ambari-agent/src/main/python/ambari_agent/AlertStatusReporter.py 20cb717 
>   ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py 
> a1f7199 
>   ambari-agent/src/main/python/ambari_agent/ClusterCache.py 2316866 
>   ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py 559a956 
>   ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py e7b7e49 
>   ambari-agent/src/main/python/ambari_agent/ComponentStatusExecutor.py 
> 66df15a 
>   ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py c60ea36 
>   ambari-agent/src/main/python/ambari_agent/InitializerModule.py 8208b32 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/AlertDefinitionsEventListener.py
>  cf72a4d 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py
>  e32c503 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/HostLevelParamsEventListener.py
>  aee2992 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/MetadataEventListener.py 
> 1e9b6e7 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py 
> 19a1d32 
>   ambari-agent/src/main/python/ambari_agent/security.py a505658 
>   ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py 
> 55c489f 
> 
> 
> Diff: https://reviews.apache.org/r/61781/diff/2/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Andrew Onischuk
> 
>



Re: Review Request 61781: Cache hashes should not be reset after restart ; some ambari-server restart fixes

2017-08-22 Thread Andrew Onischuk

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

(Updated Aug. 22, 2017, 10:34 a.m.)


Review request for Ambari, Attila Doroszlai, Dmytro Sen, Myroslav Papirkovskyy, 
and Sid Wagle.


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


Repository: ambari


Description
---

.


Diffs (updated)
-

  ambari-agent/src/main/python/ambari_agent/AlertStatusReporter.py 20cb717 
  ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py 
a1f7199 
  ambari-agent/src/main/python/ambari_agent/ClusterCache.py 2316866 
  ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py 559a956 
  ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py e7b7e49 
  ambari-agent/src/main/python/ambari_agent/ComponentStatusExecutor.py 66df15a 
  ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py c60ea36 
  ambari-agent/src/main/python/ambari_agent/InitializerModule.py 8208b32 
  
ambari-agent/src/main/python/ambari_agent/listeners/AlertDefinitionsEventListener.py
 cf72a4d 
  
ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py
 e32c503 
  
ambari-agent/src/main/python/ambari_agent/listeners/HostLevelParamsEventListener.py
 aee2992 
  ambari-agent/src/main/python/ambari_agent/listeners/MetadataEventListener.py 
1e9b6e7 
  ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py 
19a1d32 
  ambari-agent/src/main/python/ambari_agent/security.py a505658 
  ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py 55c489f 


Diff: https://reviews.apache.org/r/61781/diff/2/

Changes: https://reviews.apache.org/r/61781/diff/1-2/


Testing
---

mvn clean test


Thanks,

Andrew Onischuk



Re: Review Request 61781: Cache hashes should not be reset after restart ; some ambari-server restart fixes

2017-08-22 Thread Attila Doroszlai

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


Fix it, then Ship it!





ambari-agent/src/main/python/ambari_agent/ClusterCache.py
Lines 57-62 (original), 58-68 (patched)


It is possible to have a writer write out cache contents between reading 
the json and hash files.  To prevent this, both reads should be guarded by the 
same acquisition of `__file_lock`, ie. move `with self.__file_lock` to the 
outermost level, the same way as it is in `persist_cache`.


- Attila Doroszlai


On Aug. 21, 2017, 6:28 p.m., Andrew Onischuk wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/61781/
> ---
> 
> (Updated Aug. 21, 2017, 6:28 p.m.)
> 
> 
> Review request for Ambari, Attila Doroszlai, Dmytro Sen, Myroslav 
> Papirkovskyy, and Sid Wagle.
> 
> 
> Bugs: AMBARI-21763
> https://issues.apache.org/jira/browse/AMBARI-21763
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> .
> 
> 
> Diffs
> -
> 
>   ambari-agent/src/main/python/ambari_agent/AlertStatusReporter.py 20cb717 
>   ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py 
> a1f7199 
>   ambari-agent/src/main/python/ambari_agent/ClusterCache.py 2316866 
>   ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py 559a956 
>   ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py e7b7e49 
>   ambari-agent/src/main/python/ambari_agent/ComponentStatusExecutor.py 
> 66df15a 
>   ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py c60ea36 
>   ambari-agent/src/main/python/ambari_agent/InitializerModule.py 8208b32 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/AlertDefinitionsEventListener.py
>  cf72a4d 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py
>  e32c503 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/HostLevelParamsEventListener.py
>  aee2992 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/MetadataEventListener.py 
> 1e9b6e7 
>   
> ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py 
> 19a1d32 
>   ambari-agent/src/main/python/ambari_agent/security.py a505658 
>   ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py 
> 55c489f 
> 
> 
> Diff: https://reviews.apache.org/r/61781/diff/1/
> 
> 
> Testing
> ---
> 
> mvn clean test
> 
> 
> Thanks,
> 
> Andrew Onischuk
> 
>



Re: Review Request 61781: Cache hashes should not be reset after restart ; some ambari-server restart fixes

2017-08-21 Thread Andrew Onischuk

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

(Updated Aug. 21, 2017, 1:23 p.m.)


Review request for Ambari, Alejandro Fernandez, Dmytro Sen, Myroslav 
Papirkovskyy, and Sid Wagle.


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


Repository: ambari


Description (updated)
---

.


Diffs
-

  ambari-agent/src/main/python/ambari_agent/AlertStatusReporter.py 20cb717 
  ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py 
a1f7199 
  ambari-agent/src/main/python/ambari_agent/ClusterCache.py 2316866 
  ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py 559a956 
  ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py e7b7e49 
  ambari-agent/src/main/python/ambari_agent/ComponentStatusExecutor.py 66df15a 
  ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py c60ea36 
  ambari-agent/src/main/python/ambari_agent/InitializerModule.py 8208b32 
  
ambari-agent/src/main/python/ambari_agent/listeners/AlertDefinitionsEventListener.py
 cf72a4d 
  
ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py
 e32c503 
  
ambari-agent/src/main/python/ambari_agent/listeners/HostLevelParamsEventListener.py
 aee2992 
  ambari-agent/src/main/python/ambari_agent/listeners/MetadataEventListener.py 
1e9b6e7 
  ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py 
19a1d32 
  ambari-agent/src/main/python/ambari_agent/security.py a505658 
  ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py 55c489f 


Diff: https://reviews.apache.org/r/61781/diff/1/


Testing
---

mvn clean test


Thanks,

Andrew Onischuk



Review Request 61781: Cache hashes should not be reset after restart ; some ambari-server restart fixes

2017-08-21 Thread Andrew Onischuk

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

Review request for Ambari, Alejandro Fernandez, Dmytro Sen, and Sid Wagle.


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


Repository: ambari


Description
---


Diffs
-

  ambari-agent/src/main/python/ambari_agent/AlertStatusReporter.py 20cb717 
  ambari-agent/src/main/python/ambari_agent/ClusterAlertDefinitionsCache.py 
a1f7199 
  ambari-agent/src/main/python/ambari_agent/ClusterCache.py 2316866 
  ambari-agent/src/main/python/ambari_agent/ClusterTopologyCache.py 559a956 
  ambari-agent/src/main/python/ambari_agent/CommandStatusDict.py e7b7e49 
  ambari-agent/src/main/python/ambari_agent/ComponentStatusExecutor.py 66df15a 
  ambari-agent/src/main/python/ambari_agent/HostStatusReporter.py c60ea36 
  ambari-agent/src/main/python/ambari_agent/InitializerModule.py 8208b32 
  
ambari-agent/src/main/python/ambari_agent/listeners/AlertDefinitionsEventListener.py
 cf72a4d 
  
ambari-agent/src/main/python/ambari_agent/listeners/ConfigurationEventListener.py
 e32c503 
  
ambari-agent/src/main/python/ambari_agent/listeners/HostLevelParamsEventListener.py
 aee2992 
  ambari-agent/src/main/python/ambari_agent/listeners/MetadataEventListener.py 
1e9b6e7 
  ambari-agent/src/main/python/ambari_agent/listeners/TopologyEventListener.py 
19a1d32 
  ambari-agent/src/main/python/ambari_agent/security.py a505658 
  ambari-agent/src/test/python/ambari_agent/TestAgentStompResponses.py 55c489f 


Diff: https://reviews.apache.org/r/61781/diff/1/


Testing
---

mvn clean test


Thanks,

Andrew Onischuk