Osprofiler trace_cls has various issues

Bug #1537944 reported by Joshua Harlow
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
osprofiler
In Progress
Undecided
Unassigned

Bug Description

So the usage of @trace_cls has various issues.

1. It doesn't work with subclassing correctly.

If u check out https://review.openstack.org/272314 and run https://gist.github.com/harlowja/851679cc5f513aa54a94 you will see that the A class now has the traces of B, even though A should not be affected by B.

2. It doesn't work when stacked, if multiple @trace_cls are done, then this will generate some weird crap/hierarchy of decorators that will be traced (this is also related to subclassing).

3. If a subclass uses different arguments to @trace_cls, differing from what its parent used, the subclass @trace_cls settings will overwrite its parents, and weird crap will come out.

The traced meta class may also be affected by some of the above...

Joshua Harlow (harlowja)
description: updated
Dina Belova (dbelova)
Changed in osprofiler:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on osprofiler (master)

Change abandoned by Joshua Harlow (<email address hidden>) on branch: master
Review: https://review.openstack.org/273294

Revision history for this message
Vipin Balachandran (vbala) wrote :
Changed in osprofiler:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to osprofiler (master)

Reviewed: https://review.openstack.org/271579
Committed: https://git.openstack.org/cgit/openstack/osprofiler/commit/?id=aa60db6e4169aa4777320bad136333e90e24c4f3
Submitter: Jenkins
Branch: master

commit aa60db6e4169aa4777320bad136333e90e24c4f3
Author: Joshua Harlow <email address hidden>
Date: Fri Jan 22 16:32:38 2016 -0800

    Avoid multiple tracing when applying meta or class decorator

    If users have already traced there own class functions or
    parent class functions, the trace decorating should not
    once again trace those methods more than once because this
    seems bad and not the users actual intention.

    Partial-Bug: 1537944

    Change-Id: I97335a61a3395eab95c4638db174d1776ad4804c

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.