<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 25, 2017 at 12:59 AM Gianluca Cecchi <<a href="mailto:gianluca.cecchi@gmail.com">gianluca.cecchi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 7, 2016 at 3:35 PM, Simone Tiraboschi <span dir="ltr"><<a href="mailto:stirabos@redhat.com" target="_blank">stirabos@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_extra"><br></div><div class="gmail_extra">If I can apply the patch also to 4.0.3 I'm going to see if there is then a different behavior. </div><div class="gmail_extra">Let me know,</div><div class="gmail_extra"><br></div></div><div class="gmail_quote"><div><div class="m_5390084547884666653gmail-m_-8336235571403298980gmail-h5"><div><br></div></div></div><div>I'm trying it right now.</div><div>Any other tests will be really appreciated.</div><div><br></div><div>The patch is pretty simply, you can apply that on the fly.</div><div>You have to shutdown ovirt-ha-broker and ovirt-ha-agent; then you could directly edit </div><div>/usr/lib/python2.7/site-packages/api/vdsmapi.py<br></div><div>around line 97 changing from</div><div>loaded_schema = yaml.load(f)<br></div><div>to</div><div>loaded_schema = yaml.load(f, Loader=yaml.CLoader)<br></div><div>Please pay attention to keep exactly the same amount of initial spaces.<br></div><div><br></div><div>Then you can simply restart the HA agent and check.</div><br></div></div></div></blockquote></div><br><br></div></div><div dir="ltr"><div class="gmail_extra">Hello,<br>I'm again registering high spikes of ovirt-ha-agent with only 2-3 VMs up and with almost no activity<br>The package of the involved file /usr/lib/python2.7/site-packages/api/vdsmapi.py is now at veriosn vdsm-api-4.19.4-1.el7.centos.noarch and I see that the file contains this kind of lines<br><br> 129 try:<br> 130 for path in paths:<br> 131 with open(path) as f:<br> 132 if hasattr(yaml, 'CLoader'):<br> 133 loader = yaml.CLoader<br> 134 else:<br> 135 loader = yaml.Loader<br> 136 loaded_schema = yaml.load(f, Loader=loader)<br> 137 <br> 138 types = loaded_schema.pop('types')<br> 139 self._types.update(types)<br> 140 self._methods.update(loaded_schema)<br> 141 except EnvironmentError:<br> 142 raise SchemaNotFound("Unable to find API schema file")<br><br></div><div class="gmail_extra">So there is a conditional statement...<br></div><div class="gmail_extra">How can I be sure that "loader" is set to "yaml.CLoader" that was what in 4.0 was able to lower the cpu usage of ovirt-ha-agent?<br></div></div></blockquote><div><br></div><div>Hi Gianluca,</div><div><br></div><div>You can run this on the host:</div><div><br></div><div>$ python -c "import yaml; print 'CLoader:', hasattr(yaml, 'CLoader')"</div><div>CLoader: True</div><div><br></div><div>If you get "CLoader: False", you have some packaging issue, CLoader</div><div>is available on all supported platforms.</div><div><br></div><div>Nir</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">Gianluca<br></div><div class="gmail_extra"><br></div></div>
</blockquote></div></div>