hacking check needed for using greenthread.spawn()

Bug #1468513 reported by Matt Riedemann
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Ryan Rossiter

Bug Description

Given https://review.openstack.org/#/c/183144/ and bug 1404268, we should have a hacking check such that anytime someone tries to use greenthread.spawn() in code it's a pep8 failure - they should be using nova.utils.spawn() instead.

nova-specific hacking checks go here:

http://git.openstack.org/cgit/openstack/nova/tree/nova/hacking/checks.py

Matt Riedemann (mriedem)
Changed in nova:
status: New → Triaged
importance: Undecided → Low
Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Ryan Rossiter (rlrossit)
Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Ryan Rossiter (rlrossit) → Qin Zhao (zhaoqin)
Changed in nova:
assignee: Qin Zhao (zhaoqin) → Ryan Rossiter (rlrossit)
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/211643

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/195713
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=97821a9c7e1aff420ef2de319e158630ce811551
Submitter: Jenkins
Branch: master

commit 97821a9c7e1aff420ef2de319e158630ce811551
Author: Ryan Rossiter <email address hidden>
Date: Tue Aug 11 15:10:48 2015 +0000

    Add hacking check for greenthread.spawn()

    Because greenthread.spawn() and spawn_n() are missing a nova context
    (see I3623e60c49e442e2431cf017540422aa59bc285a and
    Ia5175c9729069df3d779237ba6039cf5bc920018), nova.utils.spawn() and
    spawn_n() should be used when spawning threads. This change adds a
    hacking check to assert this is being done during pep8.

    Change-Id: Id52c30bb5ded2184d772e6026b0f04f9a0efeb55
    Related-Bug: #1404268
    Closes-Bug: #1468513

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/211643
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6179854ae77960d4ae883349626069023b407cb0
Submitter: Jenkins
Branch: master

commit 6179854ae77960d4ae883349626069023b407cb0
Author: Ryan Rossiter <email address hidden>
Date: Thu Jun 25 14:41:49 2015 +0000

    Add hacking check for eventlet.spawn()

    Change Id52c30bb5ded2184d772e6026b0f04f9a0efeb55 added a hacking check
    for greenthread.spawn(). Since eventlet.spawn() calls
    greenthread.spawn() under the covers, it should also be checked. Because
    there are still occurrences of eventlet.spawn(), these were also cleaned
    up in order to pass the added hacking check.

    Co-Authored-By: Qin Zhao <email address hidden>

    Change-Id: Ia125b4ad5e84bf48091af5a7a483b89629f0ec31
    Related-Bug: #1404268
    Closes-Bug: #1468513

Thierry Carrez (ttx)
Changed in nova:
milestone: liberty-3 → 12.0.0
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0b1

This issue was fixed in the openstack/nova 13.0.0.0b1 development milestone.

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.