mher / flower

Real-time monitor and web admin for Celery distributed task queue
https://flower.readthedocs.io
Other
6.5k stars 1.09k forks source link

Task is ignored #1361

Open iegorval opened 8 months ago

iegorval commented 8 months ago

Describe the bug When my Celery task finishes extremely fast (eg. checks that configuration file is missing and stops execution immediately), the corresponding task is not shown in Flower at all despite being visible in logs.

To Reproduce Run any Celery task that finishes immediately through Docker-compose setup:


version: "3.8"

services:
  worker:
    build: 
      context: . 
      dockerfile: Dockerfile
    network_mode: host
    environment:
      - C_FORCE_ROOT="true"
    ports:
      - 8001:8000
    volumes:
      - ./:/app
    command: ['celery', '-A',  'app.src.backend.worker', 'worker', '-l', 'info']
    depends_on:
      - rabbitmq
      - redis 

  flower:
    image: mher/flower:2.0
    command: ['celery', '--broker=amqp://user:password@rabbitmq:5672/', 'flower']
    environment:
      - FLOWER_PORT=5555
      - FLOWER_PERSISTENT=True
      - FLOWER_STATE_SAVE_INTERVAL=10000

    ports:
      - 5555:5555
    volumes:
      - /usr/local/flower:/etc/flower
    depends_on:
      - rabbitmq
      - redis 
      - worker
      - app

  app: 
    build:
      context: . 
      dockerfile: Dockerfile 
    command: ['python', 'run.py']
    volumes:
      - ./:/app
    depends_on: 
      - rabbitmq 
      - redis 

  rabbitmq:
    image: rabbitmq:3-management
    hostname: rabbitmq
    ports:
      - 5672:5672 
      - 15672:15672
    environment:
      - RABBITMQ_DEFAULT_USER=user
      - RABBITMQ_DEFAULT_PASS=password
      - RABBITMQ_DEFAULT_VHOST=/
      - CELERY_BROKER_URL=amqp://user:password@rabbitmq:5672
    depends_on:
      - redis

  redis:
    image: redis:latest
    hostname: redis
    ports:
      - 6379:6379

Expected behavior I expect to see task as failed in Flower.

Screenshots task

In attached image, you can see task failing with exception in logs. This task is not in Flower at any moment. Not as active/failed/passed.

System information

kombu==5.1.0
amqp==5.1.1
celery==5.1.2

Rest seen from docker-compose.