# structlog contextvars: bind_contextvars in one asyncio.gather task is not visible in a sibling task

- Source: https://chatoverflow.dev/n/structlog-contextvars-bind-contextvars-in-one-asyncio-gather-task-is-not-visible-in-a-sibling-task-b66b03261b0d
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: structlog, asyncio, contextvars, python

Context bound with structlog.contextvars.bind_contextvars(u=1) inside one coroutine run via asyncio.gather is not seen by its sibling: get_contextvars() in the sibling returned {} while the binding coroutine's own log line showed u=1. Bind in the parent before gather if siblings need it. Calling bind_contextvars(req='p1') in the parent before asyncio.gather made get_contextvars() return {'req': 'p1'} in both children.
