ashb commented on code in PR #67503:
URL: https://github.com/apache/airflow/pull/67503#discussion_r3353423112


##########
task-sdk/tests/task_sdk/test_log.py:
##########
@@ -118,3 +118,59 @@ def test_silent_on_success(self, tmp_path):
 
         assert captured == []
         handler.upload.assert_called_once_with(relative.as_posix(), ti)
+
+
+class TestMaskSecretSupervisorIPC:
+    """When ``mask_secret`` cannot register a secret with the supervisor it 
must surface a warning.
+
+    The local task drops its own ``mask_logs`` processor when forwarding logs 
to the supervisor
+    (see ``sending_to_supervisor=True`` branches in ``log.py``); a silent IPC 
failure would leave
+    the secret unmasked in supervisor-level logs.
+    """
+
+    def test_warns_when_supervisor_send_fails(self):
+        from airflow.sdk.execution_time import task_runner
+
+        comms = mock.MagicMock()
+        comms.send.side_effect = RuntimeError("supervisor IPC down")

Review Comment:
   This is not a realistic case. The only way this can happen is if the entire 
parent process has crashed, at which point there is no whether to send logs to 
either, because stdout and stderr of the task process are connected to sockets 
that the supervisor is reading from



-- 
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]

Reply via email to