Dev-iL commented on code in PR #73414:
URL: https://github.com/apache/airflow/pull/73414#discussion_r4547123150


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -729,6 +731,10 @@ def _run_parsing_loop(self):
         # needs to be done before this process is forked to create the DAG 
parsing processes.
         if self.api_client is None:
             SecretCache.init()
+            # SDK lookups and the in-process API must share the cache 
inherited by parsing forks.
+            ServerSecretCache._cache = SecretCache._cache

Review Comment:
   Done:
   - The [shared cache now owns `share()` and 
`is_initialized()`](https://github.com/apache/airflow/blob/daea32bbee750b4f03ba97eef1f649afef0ad314/shared/secrets_backend/src/airflow_shared/secrets_backend/cache.py#L85).
 The [Dag 
processor](https://github.com/apache/airflow/blob/daea32bbee750b4f03ba97eef1f649afef0ad314/airflow-core/src/airflow/dag_processing/manager.py#L735)
 and 
[resolver](https://github.com/apache/airflow/blob/daea32bbee750b4f03ba97eef1f649afef0ad314/airflow-core/src/airflow/secrets/resolver.py#L94)
 use those methods instead of accessing the cache's private state.
   - I also removed the unused core `init()`. The [core adapter's 
docstring](https://github.com/apache/airflow/blob/daea32bbee750b4f03ba97eef1f649afef0ad314/airflow-core/src/airflow/secrets/cache.py#L23)
 now describes its role as the Dag processor's shared cache view; standalone 
API servers leave it uninitialized.
   
   
[Regressions](https://github.com/apache/airflow/blob/daea32bbee750b4f03ba97eef1f649afef0ad314/shared/secrets_backend/tests/secrets_backend/test_cache.py#L30)
 cover initialized and uninitialized sharing, shared writes and invalidation, 
and expiration. All 138 focused core, SDK, and shared-library cases passed in 
Breeze, along with the amend hooks.



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