Stop exposing the greenthread abstraction in compute.manager

Bug #1161965 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Undecided
Unassigned

Bug Description

In order to make it easier to someday (or maybe not someday) move off of greenlet/eventlet it would be nice to not always expose things like greenthread.sleep(0) in code, but instead put an abstraction layer up that performs this action instead.

For example:

for bw_ctr in bw_counters:
    # Allow switching of greenthreads between queries.
    greenthread.sleep(0)
    # Do work...

Instead this could be:

for bw_ctr in task_switcher_iter(bw_counters):
    # Do work...

Notice that we can now make the 'task_switcher_iter' do the greenthread.sleep
or not do it at all, thus making the code cleaner and making it easier to drop
eventlet if this ever becomes a issue (aka with python3 lacking eventlet support)

Joshua Harlow (harlowja)
summary: - Stop exposing the greenthread abstraction
+ Stop exposing the greenthread abstraction in compute.manager
Changed in nova:
assignee: nobody → Joshua Harlow (harlowja)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/25751

Changed in nova:
status: New → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

The patch was abandoned with a lot of comments from Chris Behrens, is this worth pursuing?

Changed in nova:
status: In Progress → Triaged
assignee: Joshua Harlow (harlowja) → nobody
Joe Gordon (jogo)
Changed in nova:
status: Triaged → Opinion
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.