potiuk edited a comment on pull request #19860:
URL: https://github.com/apache/airflow/pull/19860#issuecomment-982552894


   OK. @ashb @ephraimbuddy @uranusjr - I think I have a final confirmation that 
this is the deferred reload from "spawn" test. 
   
   When I moved the `test_scheduler_multiprocessing_with_spawn_method` after 
`test_scheduler_keeps_scheduling_pool_full`  the "pool_full' tests stopped 
failing, but the failures moved few tests down:
   
   * test_more_runs_are_not_created_when_max_active_runs_is_reached: 
      * 
https://github.com/apache/airflow/runs/4365506164?check_suite_focus=true#step:6:3949
   * test_retry_still_in_executor:
      *  
https://github.com/apache/airflow/runs/4365506225?check_suite_focus=true#step:6:3987
      *  
https://github.com/apache/airflow/runs/4365505499?check_suite_focus=true#step:6:4408
   * test_verify_integrity_if_dag_failed: 
      * 
https://github.com/apache/airflow/runs/4365505550?check_suite_focus=true#step:6:4384
   
   In 3 of the 4 tests (the first is exception) you can see the same side 
effect (even more likely than before coming from the `spawned` test):
   
   ```
   {settings.py:52} INFO - Configured default timezone Timezone('UTC')
   ```
   
   I think in the first case the "log" entry was simply printed during the 
tearDown of the previous tests.
   
   And I have a theory that could explain why reloading MIGHT cause the problem 
(or big part of it). @uranusjr - this is similar to the equality test problem 
you solved recently in #19878 . 
   
   My theory is that while reloading settings, the Model classes get reloaded 
and they are different `class` objects than they were a while ago. SQLAlchemy 
when runnig SerializedDagModel.get() will find the objects in session only if 
they are the same Class. But when the reload happens, the `dag_maker` for 
whatever reason will use the new  `SerializedDagModel` class - which  is 
different than `SerializedDagModel` when the model is queried with (this class 
object is likely already loaded before and not reloaded).
   
   Now - I still have no idea why spawned dag processor reload might cause it 
as it shoudl be a different process and different python interpreter,  I can 
disable the `spawn` test case or separate it to be run completely 
independently, but it would be great to find out if similar side effects can 
happen outside of test environment. 
   
   
   
   


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