amoghrajesh commented on code in PR #60826:
URL: https://github.com/apache/airflow/pull/60826#discussion_r2711145666


##########
shared/logging/src/airflow_shared/logging/remote.py:
##########
@@ -0,0 +1,95 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+from __future__ import annotations
+
+import os
+from collections.abc import Callable
+from importlib import import_module
+from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
+
+import structlog
+
+if TYPE_CHECKING:
+    # Use Any for forward references to avoid importing concrete types
+    RuntimeTI = Any  # Type alias for RuntimeTaskInstance protocol
+    LogResponse = tuple[Any, Any]  # Type alias for (messages, logs)
+    StreamingLogResponse = tuple[Any, Any]  # Type alias for streaming response
+
+log = structlog.getLogger(__name__)
+
+

Review Comment:
   
   I thought about it briefly yday and I think keeping it separate is a better 
approach. Let me explain:
   
   RIght now, core and sdk each have their own _ActiveLoggingConfig which both 
need cos:
   
   Task sdk needs to write remote logs
   API server needs it to that it can read and display logs on UI
   Both have their own config, defaults, and no confusion. They are both inited 
during their respective bootups and are cached during the process lifecycle 
separately.
   
   By moving it to shared, what I am worried about is that _ActiveLoggingConfig 
is a stateful cache so it we would be modifying the shared state when it 
shouldn't be shared and should have a separate instance per process since its a 
singleton. Does it make sense?



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