nuclearpinguin commented on a change in pull request #7206: [AIRFLOW-6591] Add 
cli option to stop celery worker
URL: https://github.com/apache/airflow/pull/7206#discussion_r368258541
 
 

 ##########
 File path: airflow/cli/commands/celery_command.py
 ##########
 @@ -115,23 +127,19 @@ def worker(args):
         'autoscale': autoscale,
         'hostname': args.celery_hostname,
         'loglevel': conf.get('logging', 'LOGGING_LEVEL'),
+        'pidfile': pid_file_path,
     }
 
     if conf.has_option("celery", "pool"):
         options["pool"] = conf.get("celery", "pool")
 
     if args.daemon:
-        pid, stdout, stderr, log_file = setup_locations("worker",
-                                                        args.pid,
-                                                        args.stdout,
-                                                        args.stderr,
-                                                        args.log_file)
+        # Run Celery worker as daemon
         handle = setup_logging(log_file)
         stdout = open(stdout, 'w+')
         stderr = open(stderr, 'w+')
 
         ctx = daemon.DaemonContext(
-            pidfile=TimeoutPIDLockFile(pid, -1),
 
 Review comment:
   After my changes pid file is handled by Celery builtin mechanism and 
standard lockfile / psutil methods in stop command.   

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


With regards,
Apache Git Services

Reply via email to