@@ -365,7 +365,10 @@ def helper():
365
365
stdout = StreamLogWriter (log , logging .INFO )
366
366
stderr = StreamLogWriter (log , logging .WARN )
367
367
368
+ log .info ("Setting log context for file {}" .format (file_path ))
369
+ # log file created here
368
370
set_context (log , file_path )
371
+ log .info ("Successfully set log context for file {}" .format (file_path ))
369
372
370
373
try :
371
374
# redirect stdout/stderr to log
@@ -384,6 +387,7 @@ def helper():
384
387
log .info ("Started process (PID=%s) to work on %s" ,
385
388
os .getpid (), file_path )
386
389
scheduler_job = SchedulerJob (dag_ids = dag_id_white_list , log = log )
390
+ log .info ("Processing file {}" .format (file_path ))
387
391
result = scheduler_job .process_file (file_path ,
388
392
pickle_dags )
389
393
result_queue .put (result )
@@ -412,6 +416,7 @@ def start(self):
412
416
"""
413
417
Launch the process and start processing the DAG.
414
418
"""
419
+ self .log .info ("Launching process to process DAG at {}" .format (self .file_path ))
415
420
self ._process = DagFileProcessor ._launch_process (
416
421
self ._result_queue ,
417
422
self .file_path ,
@@ -1671,6 +1676,7 @@ def _execute_helper(self, processor_manager):
1671
1676
# Kick of new processes and collect results from finished ones
1672
1677
self .log .debug ("Heartbeating the process manager" )
1673
1678
simple_dags = processor_manager .heartbeat ()
1679
+ self .log .debug ("Finished process manager heartbeat" )
1674
1680
1675
1681
if self .using_sqlite :
1676
1682
# For the sqlite case w/ 1 thread, wait until the processor
@@ -1700,6 +1706,9 @@ def _execute_helper(self, processor_manager):
1700
1706
State .SCHEDULED ],
1701
1707
State .NONE )
1702
1708
1709
+ scheduled_dag_ids = ", " .join (simple_dag_bag .dag_ids )
1710
+ self .log .info ('DAGs to be executed: {}' .format (scheduled_dag_ids ))
1711
+
1703
1712
self ._execute_task_instances (simple_dag_bag ,
1704
1713
(State .SCHEDULED ,))
1705
1714
@@ -1741,14 +1750,17 @@ def _execute_helper(self, processor_manager):
1741
1750
break
1742
1751
1743
1752
# Stop any processors
1753
+ self .log .info ("Terminating DAG processors" )
1744
1754
processor_manager .terminate ()
1755
+ self .log .info ("All DAG processors terminated" )
1745
1756
1746
1757
# Verify that all files were processed, and if so, deactivate DAGs that
1747
1758
# haven't been touched by the scheduler as they likely have been
1748
1759
# deleted.
1749
1760
all_files_processed = True
1750
1761
for file_path in known_file_paths :
1751
1762
if processor_manager .get_last_finish_time (file_path ) is None :
1763
+ self .log .info ("File {} not processed" .format (file_path ))
1752
1764
all_files_processed = False
1753
1765
break
1754
1766
if all_files_processed :
0 commit comments