codeant-ai-for-open-source[bot] commented on code in PR #45364:
URL: https://github.com/apache/superset/pull/45364#discussion_r4290103304


##########
superset/initialization/__init__.py:
##########
@@ -151,9 +151,21 @@ def configure_celery(self) -> None:
         # setup properly
         task_base = celery_app.Task
 
+        # ``celery_app`` is a process-wide singleton, so a second 
initialization
+        # in the same process (the unit suite builds one app per test module)
+        # finds the wrapper installed by the previous one. Wrap the original
+        # base again instead of wrapping the wrapper: a chain of wrappers keeps
+        # every app ever initialized reachable through the task class
+        # hierarchy, and the suite's memory then grows with every module. Only
+        # this method installs the marked wrapper, so one level is unwrapped.
+        if "_superset_app_context_task" in vars(task_base):
+            task_base = task_base._superset_task_base

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `1044d8c`.
   
   The wrapper no longer closes over a specific app; it reads the module-level 
`_celery_task_app`, which is updated on each initialization. The marker check 
prevents wrapping the singleton task class again.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to