loopingcall _Event patching check logic is backward

Bug #1798774 reported by Thomas Herve on 2018-10-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.service
Undecided
Thomas Herve

Bug Description

This is oslo_service version of bug #1518430.

I noticed unusual CPU activity when using ThreadGroup.add_timer in Heat. Digging down, I saw that loopingcall used a _Event function, which dispatches to threading.Event when thread is patched. But, when threading.Event is used with eventlet, it creates lots of useless system calls (see linked bug).

I believe the logic should be the other way: use threading.Event when not patched, and greenthread otherwise.

Thomas Herve (therve) on 2018-10-19
Changed in oslo.service:
assignee: nobody → Thomas Herve (therve)

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

Changed in oslo.service:
status: New → In Progress
Changed in oslo.service:
assignee: Thomas Herve (therve) → Zane Bitter (zaneb)
Changed in oslo.service:
assignee: Zane Bitter (zaneb) → Thomas Herve (therve)

Reviewed: https://review.openstack.org/611807
Committed: https://git.openstack.org/cgit/openstack/oslo.service/commit/?id=c2463470f5e7edad1ffd369a472267d559590495
Submitter: Zuul
Branch: master

commit c2463470f5e7edad1ffd369a472267d559590495
Author: Thomas Herve <email address hidden>
Date: Fri Oct 19 10:45:48 2018 +0200

    Use eventlet Event for loopingcall events

    This fixes broken logic for finding out how to use green threads. Using
    threading.Event with eventlet creates useless load related to timers.

    Change-Id: I62e9f1a7cde8846be368fbec58b8e0825ce02079
    Closes-Bug: #1798774

Changed in oslo.service:
status: In Progress → Fix Released

This issue was fixed in the openstack/oslo.service 1.32.1 release.

Reviewed: https://review.openstack.org/614489
Committed: https://git.openstack.org/cgit/openstack/oslo.service/commit/?id=6566ec5e4b143f47a835223e5bcbe68766c52f7a
Submitter: Zuul
Branch: stable/rocky

commit 6566ec5e4b143f47a835223e5bcbe68766c52f7a
Author: Thomas Herve <email address hidden>
Date: Fri Oct 19 10:45:48 2018 +0200

    Use eventlet Event for loopingcall events

    This fixes broken logic for finding out how to use green threads. Using
    threading.Event with eventlet creates useless load related to timers.

    Change-Id: I62e9f1a7cde8846be368fbec58b8e0825ce02079
    Closes-Bug: #1798774
    (cherry picked from commit c2463470f5e7edad1ffd369a472267d559590495)

tags: added: in-stable-rocky

This issue was fixed in the openstack/oslo.service 1.31.6 release.

Reviewed: https://review.openstack.org/619342
Committed: https://git.openstack.org/cgit/openstack/oslo.service/commit/?id=d555763f8f2fd56ae3e11990d095a52097e452f4
Submitter: Zuul
Branch: stable/rocky

commit d555763f8f2fd56ae3e11990d095a52097e452f4
Author: Zane Bitter <email address hidden>
Date: Wed Nov 21 14:28:02 2018 -0500

    Maintain private interface for loopingcall._ThreadingEvent

    A previous patch replaced the _Event() function and _ThreadingEvent()
    class in oslo_service.loopingcall with a single _Event() class. However,
    some consumers of oslo_service (including Nova) were relying on the
    private interface to mock methods during unit testing, which prevents
    them updating to the latest version of oslo.service.

    Make '_ThreadingEvent' a reference to the _Event class, and add
    deprecated methods compatible with the previous interface, so that the
    private interface does not change.

    This is a stable-only change, because on master we now require consumers
    to use oslo_service.fixture.SleepFixture rather than rely on the private
    interface.

    Change-Id: I37b38c8e1382cdf28a533dfcfc017d238c3f2684
    Related-Bug: #1798774

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers