The recent [refactoring of the celery Worker process](https://github.com/apache/airflow/commit/02ce45cafec22a0a80257b2144d99ec8bb41c961) dropped the use of `celery.bin.worker.Worker()`, and switched to using the `celery.app.worker.Worker()` class more directly.

Unfortunately, it was the task of the former to format the [Celery hostname patterns](https://docs.celeryproject.org/en/latest/reference/cli.html?highlight=hostname#cmdoption-celery-worker-n).

Unfortunately this refactoring dropped support for hostname patterns (`%h`, `%n`, etc.). Can we re-introduce these? All that is needed is a few `celery.utils.nodenames` calls:

```python
from celery.utils.nodenames import default_nodename, host_format

        # ...
        'hostname': host_format(default_nodename(args.celery_hostname)),
```
airflow/executors/celery_executor.py
just resend them. We do that by clearing the state and letting the
        normal scheduler loop deal with that
        """
        now = utcnow()
        timedout_keys = []
        for key, stalled_after in self.adopted_task_timeouts.items():
            if stalled_after > now:
                
                
                break
            
            
            
            
            
            
            
            timedout_keys.append(key)
        if timedout_keys:
            self.log.error(
                "Adopted tasks were still pending after %s, assuming they never made it to celery and "
                "clearing:\n\t%s",
                self.task_adoption_timeout,
                "\n\t".join([repr(x) for x in timedout_keys])
            )
            for key in timedout_keys:
                self.event_buffer[key] = (State.FAILED, None)
                del self.tasks[key]
                del self.adopted_task_timeouts[key]
    def update_all_task_states(self) -> None: