• Dridi Boukelmoune's avatar
    ws: Tie workspace logs to their transactions · 588d5c45
    Dridi Boukelmoune authored
    That is, when it's a request or backend transaction, otherwise it's
    still logged with VXID 0. The goal is to allow a correlation between
    VCL statements and their workspace footprint by sharing the same
    transaction instead of being split between raw and vxid scopes. That
    kind of debugging becomes possible when the workspace debug flag is
    used and VCL_trace records are not masked.
    
    Given the verbosity of both workspace and trace logs, we would need
    new tools to process transactions for this purpose and until we can
    link everything we have a chicken-egg problem.
    
    This change does not go all the way and relies on the thread-local
    worker reference to opportunistically log into its VSL buffer when
    it has one. When the workspace is initialized, the buffer may not
    be ready yet, so some logs may still end up raw. What's likely going
    to be missing is workspace early initialization and teardown: in other
    words before and after VCL execution, which should be good enough for
    the purpose of debugging workspace operations in VCL tasks.
    588d5c45