Log module: memory footprint size used in contextual information twice bigger than expected

Bug #1268518 reported by Bertrand Lallau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.log
Invalid
Medium
Bertrand Lallau

Bug Description

The log ContextAdapter used to specify contextual informations in logging output produce a context twice bigger than expected ("extra" informations are duplicated).
Actually the following is generated:

kwargs={
    'extra': {
        'project_name': 'project_name',
        'extra': {
            'project_name': 'project_name',
            'timestamp': '2014-01-13T09: 10: 10.942287',
            'auth_token': '47b920091df0492ca16314e22c3f5ff9',
            'remote_address': '127.0.0.1',
            'quota_class': None,
            'is_admin': False,
            'user': '6d029d604ed54d8e93ccae62d665aa64',
            'service_catalog': [

            ],
            'tenant': '1b7a085905d84b3793d58f219774a86a',
            'user_id': '6d029d604ed54d8e93ccae62d665aa64',
            'roles': [
                'user'
            ],
            'project': 'nova.api.openstack.compute.servers',
            'instance': '',
            'version': 'unknown',
            'read_deleted': 'no',
            'request_id': 'req-128e3666-57a9-44e1-a60a-a16a099b0da9',
            'instance_lock_checked': False,
            'project_id': '1b7a085905d84b3793d58f219774a86a',
            'user_name': 'project_name'
        },
        'timestamp': '2014-01-13T09: 10: 10.942287',
        'auth_token': '47b920091df0492ca16314e22c3f5ff9',
        'remote_address': '127.0.0.1',
        'quota_class': None,
        'is_admin': False,
        'user': '6d029d604ed54d8e93ccae62d665aa64',
        'service_catalog': [

        ],
        'tenant': '1b7a085905d84b3793d58f219774a86a',
        'user_id': '6d029d604ed54d8e93ccae62d665aa64',
        'roles': [
            'user'
        ],
        'project': 'nova.api.openstack.compute.servers',
        'instance': '',
        'version': 'unknown',
        'read_deleted': 'no',
        'request_id': 'req-128e3666-57a9-44e1-a60a-a16a099b0da9',
        'instance_lock_checked': False,
        'project_id': '1b7a085905d84b3793d58f219774a86a',
        'user_name': 'project_name'
    }
}

It should be:

kwargs={
    'extra': {
        'project_name': 'project_name',
        'timestamp': '2014-01-13T09: 10: 10.942287',
        'auth_token': '47b920091df0492ca16314e22c3f5ff9',
        'remote_address': '127.0.0.1',
        'quota_class': None,
        'is_admin': False,
        'user': '6d029d604ed54d8e93ccae62d665aa64',
        'service_catalog': [

        ],
        'tenant': '1b7a085905d84b3793d58f219774a86a',
        'user_id': '6d029d604ed54d8e93ccae62d665aa64',
        'roles': [
            'user'
        ],
        'project': 'nova.api.openstack.compute.servers',
        'instance': '',
        'version': 'unknown',
        'read_deleted': 'no',
        'request_id': 'req-128e3666-57a9-44e1-a60a-a16a099b0da9',
        'instance_lock_checked': False,
        'project_id': '1b7a085905d84b3793d58f219774a86a',
        'user_name': 'project_name'
    }
}

ContextAdapter is called each time an Openstack service produced a log,
hence memory impacted is really not insignificant.

Tags: log
Changed in oslo:
assignee: nobody → Bertrand Lallau (bertrand-lallau)
Changed in oslo:
importance: Undecided → Medium
status: New → Triaged
Changed in oslo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

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

Changed in oslo:
status: In Progress → Confirmed
affects: oslo-incubator → oslo.log
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

It seems the original problem does not exists in the current oslo.log lib, see https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py#L165

Changed in oslo.log:
status: Confirmed → Invalid
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.