class_docstr: CeleryExecutor is recommended for production use of Airflow.
  
  It allows distributing the execution of task instances to multiple worker nodes.
  
  Celery is a simple, flexible and reliable distributed system to process
  vast amounts of messages, while providing operations with the tools
  required to maintain such a system.
class_docstr_tok: ["CeleryExecutor","is","recommended","for","production","use","of","Airflow",".","It","allows","distributing","the","execution","of","task","instances","to","multiple","worker","nodes",".","Celery","is","a","simple",",","flexible","and","reliable","distributed","system","to","process","vast","amounts","of","messages",",","while","providing","operations","with","the","tools","required","to","maintain","such","a","system","."]
docstr: Update states of the tasks.
docstr_tok: ["Update","states","of","the","tasks","."]
code: def update_all_task_states(self) -> None:
      """Update states of the tasks."""
      self.log.debug(
          "Inquiring about %s celery task(s)", len(self.tasks)
      )
      state_and_info_by_celery_task_id = (
          self.bulk_state_fetcher.get_many(self.tasks.values())
      )
  
      self.log.debug("Inquiries completed.")
      for key, async_result in list(self.tasks.items()):
          state, info = state_and_info_by_celery_task_id.get(
              async_result.task_id
          )
          if state:
              self.update_task_state(key, state, info)
  
imports: from __future__ import annotations
  import logging
  import math
  import operator
  import time
  from collections import Counter
  from concurrent.futures import ProcessPoolExecutor
  from multiprocessing import cpu_count
  from typing import TYPE_CHECKING, Any, Optional, Sequence, Tuple
  from celery import states
  from airflow.configuration import conf
  from airflow.exceptions import AirflowTaskTimeout
  from airflow.executors.base_executor import BaseExecutor
  from airflow.stats import Stats
  from airflow.utils.state import TaskInstanceState
label_desc: Use image node_id 8 for calling the CeleryExecutor obj's underlying member method code with example usage: obj.update_all_task_states() without return types