potiuk commented on PR #67503: URL: https://github.com/apache/airflow/pull/67503#issuecomment-4627244474
Fair point that in a full supervisor crash the warning can't be delivered — stdout/stderr are the supervisor's sockets, as you say. But `comms.send()` raising isn't *only* the crash case: the `MaskSecret` message can fail to build/serialize **before** the socket is touched. `MaskSecret.value` is `JsonValue`, and `send()` runs `_make_frame(msg).as_bytes()` (pydantic `model_dump` + msgspec encode, plus OTel trace injection) before `socket.sendall`. A non-serializable value (or an encode hiccup) raises while the supervisor is alive and reachable — so the warning is both deliverable and the only signal that registration was lost. And that's the case that actually bites: under `sending_to_supervisor=True` the task drops its own `mask_logs` processor (`log.py`), so a silently-swallowed failure leaves the secret unmasked in supervisor-level logs. The old `with suppress(Exception)` hid exactly that. You're right that the original test (a generic `RuntimeError` mock) read like the unrealistic crash case — I've reworked it: it now feeds a non-serializable value so the `MaskSecret` build genuinely fails and asserts `comms.send` is never reached (a real, supervisor-alive failure), plus a separate `BrokenPipeError` case for the socket branch. Mind taking another look? --- Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
