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_r368941447
########## 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 all this works fine, the problem is when celery process exits unexpectedly and pid file is not removed. Then running worker with -D won't start up celery and user will not receive any information. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services