<div dir="ltr">

<p class=""><span lang="EN-US">Thanks Matt for the pointers. I was already
aware of this cache mechanism. </span></p>

<p class=""><span lang="EN-US"><span style></span>However
my approach is different: I do not want to cache clients, but simply <br></span></p><p class=""><span lang="EN-US">update the
context with the token that was obtained. And if the same context <br></span></p><p class=""><span lang="EN-US">is reused, no
new token will be generated. </span></p><p class=""><span lang="EN-US">Ala<br></span></p><p class=""><span lang="EN-US"> </span></p>

<div class="gmail_extra"><br><br><div class="gmail_quote">2013/7/3 Matt Riedemann <span dir="ltr"><<a href="mailto:mriedem@us.ibm.com" target="_blank">mriedem@us.ibm.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font face="sans-serif">For some history, there was an attempt
at consolidating some of this here:</font>
<br>
<br><a href="https://github.com/openstack/nova/commit/dd9c27f999221001bae9faa03571645824d2a681" target="_blank"><font color="blue" size="3"><u>https://github.com/openstack/nova/commit/dd9c27f999221001bae9faa03571645824d2a681</u></font></a><font size="3">
</font>
<br>
<br><font face="sans-serif">But that caused some issues and was
reverted here:</font>
<br>
<br><a href="https://github.com/openstack/nova/commit/ee5d9ae8d376e41e852b06488e922400cf69b4ac" target="_blank"><font face="sans-serif">https://github.com/openstack/nova/commit/ee5d9ae8d376e41e852b06488e922400cf69b4ac</font></a><font face="sans-serif"><br>

</font>
<br><font face="sans-serif"><br>
</font>
<br><font face="Arial" size="1">Thanks,</font>
<br>
<br><font color="#8f8f8f" face="Arial" size="3"><b>MATT RIEDEMANN</b></font><font face="Arial" size="1"><br>
Advisory Software Engineer<br>
Cloud Solutions and OpenStack Development</font>
<table style="border-collapse:collapse" width="680">
<tbody><tr height="8">
<td colspan="2" style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="680">
<hr>
</td></tr><tr height="8" valign="top">
<td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="418"><font color="#4181c0" face="Arial" size="1"><b>Phone:</b></font><font color="#5f5f5f" face="Arial" size="1">
<a href="tel:1-507-253-7622" value="+15072537622" target="_blank">1-507-253-7622</a></font><font color="#4181c0" face="Arial" size="1"> | <b>Mobile:</b></font><font color="#5f5f5f" face="Arial" size="1">
<a href="tel:1-507-990-1889" value="+15079901889" target="_blank">1-507-990-1889</a></font><font color="#4181c0" face="Arial" size="1"><b><br>
E-mail:</b></font><font color="#5f5f5f" face="Arial" size="1"> </font><a href="mailto:mriedem@us.ibm.com" target="_blank"><font color="#5f5f5f" face="Arial" size="1"><u>mriedem@us.ibm.com</u></font></a>
</td><td style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px" width="261">
<div align="right"><img alt="IBM" height="30" width="83"><font color="#5f5f5f" face="Arial" size="1"><br>
<br>
3605 Hwy 52 N<br>
Rochester, MN 55901-1407<br>
United States</font></div></td></tr></tbody></table>
<br>
<br>
<br>
<br>
<br><font color="#5f5f5f" face="sans-serif" size="1">From:      
 </font><font face="sans-serif" size="1">Ala Rezmerita <<a href="mailto:ala.rezmerita@cloudwatt.com" target="_blank">ala.rezmerita@cloudwatt.com</a>></font>
<br><font color="#5f5f5f" face="sans-serif" size="1">To:      
 </font><font face="sans-serif" size="1">OpenStack Development
Mailing List <<a href="mailto:openstack-dev@lists.openstack.org" target="_blank">openstack-dev@lists.openstack.org</a>>, </font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Cc:      
 </font><font face="sans-serif" size="1"><a href="mailto:gongysh@unitedstack.com" target="_blank">gongysh@unitedstack.com</a>,
<a href="mailto:hrushikesh.gangur@hp.com" target="_blank">hrushikesh.gangur@hp.com</a></font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Date:      
 </font><font face="sans-serif" size="1">07/03/2013 11:26 AM</font>
<br><font color="#5f5f5f" face="sans-serif" size="1">Subject:    
   </font><font face="sans-serif" size="1">[openstack-dev]
[Nova] too many tokens</font>
<br>
<hr noshade>
<br>
<br>
<br><font size="3">Hi everyone, </font>
<p></p><div><div class="h5"><font size="3">I have a question regarding too many token generation in
nova when using quantumclient (also related to bug reports </font><a href="https://bugs.launchpad.net/nova/+bug/1192383" target="_blank"><font color="blue" size="3"><u>https://bugs.launchpad.net/nova/+bug/1192383</u></font></a><font size="3">
+ </font><a href="https://bugs.launchpad.net/nova-project/+bug/1191159" target="_blank"><font color="blue" size="3"><u>https://bugs.launchpad.net/nova-project/+bug/1191159</u></font></a><font size="3">)
</font>
</div></div><p></p><div><div class="h5"><font size="3">For instance during the periodic task  </font><font face="Calibri" size="3"><i>heal_instance_info_cache</i></font><font size="3">
 (every 60s) nova calls quantum API method  get_instance_nw_info
that calls _build_network_info_model (backtrace at the end of the mail). 
</font>
</div></div><p></p><div><div class="h5"><font size="3">During the execution of this method,  4 quantum clients
intances are created (all of them use the same context object) and for
each of them a new token is generated.   </font>
</div></div><p></p><div><div class="h5"><font size="3">Is it possible to change this behavior by updating the
context.auth_token property the first time a quantumclient for a given
context is created (so that the same token will be reused among the 4 client
instances) ?  Is there some security issue that can appear?</font>
</div></div><p><font size="3">Thanks</font>
</p><p><font size="3">Ala Rezmerita</font>
<br><font size="3">Cloudwatt</font>
<br>
</p><p><font size="3">The backtrace :</font>
</p><p></p><div><div class="h5"><font face="Calibri">  /usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py(194)main()<br>
-> result = function(*args, **kwargs)<br>
  /opt/stack/nova/nova/openstack/common/loopingcall.py(125)_inner()<br>
-> idle = self.f(*self.args, **</font><a href="http://self.kw/" target="_blank"><font color="blue" face="Calibri"><u>self.kw</u></font></a></div></div><font face="Calibri">)<div><div class="h5"><br>
  /opt/stack/nova/nova/service.py(283)periodic_tasks()<br>
-> return self.manager.periodic_tasks(ctxt, raise_on_error=raise_on_error)<br>
  /opt/stack/nova/nova/manager.py(100)periodic_tasks()<br>
-> return self.run_periodic_tasks(context, raise_on_error=raise_on_error)<br>
  /opt/stack/nova/nova/openstack/common/periodic_task.py(179)run_periodic_tasks()<br>
-> task(self, context)<br>
  /opt/stack/nova/nova/compute/manager.py(3654)_heal_instance_info_cache()<br>
-> self._get_instance_nw_info(context, instance)<br>
  /opt/stack/nova/nova/compute/manager.py(767)_get_instance_nw_info()<br>
-> instance, conductor_api=self.conductor_api)<br>
  /opt/stack/nova/nova/network/quantumv2/api.py(367)get_instance_nw_info()<br>
-> result = self._get_instance_nw_info(context, instance, networks)<br>
  /opt/stack/nova/nova/network/quantumv2/api.py(375)_get_instance_nw_info()<br>
-> nw_info = self._build_network_info_model(context, instance, networks)<br>
  /opt/stack/nova/nova/network/quantumv2/api.py(840)_build_network_info_model()<br>
-> client = quantumv2.get_client(context, admin=True)<br></div></div>
> /opt/stack/nova/nova/network/quantumv2/__init__.py(67)get_client()</font><tt><font>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
</font></tt><a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank"><tt><font>http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</font></tt></a><tt><font><br>
</font></tt>
<p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><p></p><br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div style="color:rgb(136,136,136)">Ala Rezmerita<br></div><div style="color:rgb(136,136,136)">Software Engineer</div><div style="color:rgb(136,136,136)">
CloudWatt</div><div style="color:rgb(136,136,136)">Tel : (+33) 06 77 43 23 91</div></div>
</div></div>