log_contexts.rst 788 B

12345678910
  1. What do I do about "Unexpected logging context" debug log-lines everywhere?
  2. <Mjark> The logging context lives in thread local storage
  3. <Mjark> Sometimes it gets out of sync with what it should actually be, usually because something scheduled something to run on the reactor without preserving the logging context.
  4. <Matthew> what is the impact of it getting out of sync? and how and when should we preserve log context?
  5. <Mjark> The impact is that some of the CPU and database metrics will be under-reported, and some log lines will be mis-attributed.
  6. <Mjark> It should happen auto-magically in all the APIs that do IO or otherwise defer to the reactor.
  7. <Erik> Mjark: the other place is if we branch, e.g. using defer.gatherResults
  8. Unanswered: how and when should we preserve log context?