potiuk commented on a change in pull request #10956:
URL: https://github.com/apache/airflow/pull/10956#discussion_r499526219



##########
File path: airflow/executors/celery_executor.py
##########
@@ -225,7 +225,15 @@ def _send_tasks_to_celery(self, task_tuples_to_send):
         # since tasks are roughly uniform in size
         chunksize = self._num_tasks_per_send_process(len(task_tuples_to_send))
         num_processes = min(len(task_tuples_to_send), self._sync_parallelism)
-        with Pool(processes=num_processes) as send_pool:
+
+        def reset_signals():
+            # Since we are run from inside the SchedulerJob, we don't to
+            # inherit the signal handlers that we registered there.
+            import signal
+            signal.signal(signal.SIGINT, signal.SIG_DFL)
+            signal.signal(signal.SIGTERM, signal.SIG_DFL)
+
+        with Pool(processes=num_processes, initializer=reset_signals) as 
send_pool:

Review comment:
       Seems that it can have some undesired consequences if the signals are 
not reset. And that this is a non-HA-scheduler bug that should be fixed 
separately and cherry-picked to 1.10?
   
   Do I get it correctly?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to