[openstack-dev] Using thread local storage for correlation_id
Russell Bryant
rbryant at redhat.com
Wed Jun 5 02:02:39 UTC 2013
On 06/04/2013 03:00 PM, Brian Elliott wrote:
> Hi Venkatesh,
>
>>
>> We are planning to make the correlation_id available for logging
>> through thread local storage especially using the existing
>> 'local.strong_store' reference. ( available from
>> oslo-incubator/openstack/common/local.py).
>> ie., by setting the correlation_id as attribute to
>> 'local.strong_store' in the correlation_id middleware.
>>
>> Wish to know if its good idea to use the thread local storage from
>> local.py for correlation_id so that it could be used by respective
>> services.
>>
>
> My personal preference is to pass the correlation id around explicitly
> rather than using thread local storage. At least in Nova, there is a
> request context where there is already a well-established pattern of
> storing this type of information.
Indeed. Thread local storage actually won't work at all for this,
anyway, IMO. Presumably you'd want this to carry on with a "request" as
it goes through difference services in nova. Setting it in TLS back in
the API service isn't going to work, except for a fraction of nova.
--
Russell Bryant
More information about the OpenStack-dev
mailing list