placement os-traits sync checked every request
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Chris Dent |
Bug Description
Most requests to the placement service eventually reach the database code in the resource_
While there is a flag to make sure that the syncing doesn't happen if it already happened before, we lock around checking that flag for nearly every request. This isn't the end of the world, but it is wasted activity and it can make a lot of noise in the logs if you're running DEBUG:
2018-03-15 17:35:37.653 7 DEBUG oslo_concurrenc
2018-03-15 17:35:37.653 7 DEBUG oslo_concurrenc
This is redundant. I'm pretty sure I wrote this code, so I'm not sure what I was thinking, probably cargo culting off ensuring the resource classes. We only need to sync the traits to the database once and we only need to check if it has been done once per process. The traits are read from a python module that is only imported once per process.
So, what we could do is move the calling of ensure_trait_sync to the part of placement that establishes the database connection facade thingie. If we merge https:/
We find the session, make a context, do the sync, set the global and never worry about it again. All the _ensure_trait_sync calls can be removed.
Fix proposed to branch: master /review. openstack. org/553857
Review: https:/