Comment 10 for bug 1288878

Revision history for this message
Sergey Gotliv (sgotliv) wrote :

Mehdi,

Today oslo.messaging fails on localcontext.clear_local_context() with totally useless message which makes me guess how is that possible that following code succeeded on set_local_context() but failed on clear_local_context(). Remember that as a user I didn't choose to use eventlet executor (its a default values) and localcontext is used internally by oslo.messaging in that case:

if hasattr(endpoint, method):
                localcontext.set_local_context(ctxt)
                try:
                    return self._do_dispatch(endpoint, method, ctxt, args)
                finally:
                    localcontext.clear_local_context()

All I am saying is that you can't break the flow on clear_local_context(), its a bad user experience. Clear must be safe operation, definitely it can't raise an AttributeError!