Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs are no longer being written, and it's unable to receive task information from the server. #560

Open
7 tasks done
zhugexinxin opened this issue Jul 8, 2023 · 0 comments

Comments

@zhugexinxin
Copy link

zhugexinxin commented Jul 8, 2023

Issues

GitHub issues are for bugs. If you have questions, please ask them on the mailing list.

Checklist

  • Does your title concisely summarize the problem?
  • Did you include a minimal, reproducible example?
  • What OS are you using?
  • What version of Dramatiq are you using?
  • What did you do?
  • What did you expect would happen?
  • What happened?

What OS are you using?

Ubuntu 22.04

What version of Dramatiq are you using?

Dramatiq '1.14.2'

What did you do?

I am using the Sanic framework, with Dramatiq as a queue, but I've encountered two peculiar issues.

  1. I am simply using dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/log/dramatiq.log. After executing a few times and encountering some simple errors, if I exit and restart, the log file no longer receives any input.
image

Only the startup log will be displayed, and no further logs will be written.

$ dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/log/dramatiq.log

import dramatiq
from dramatiq.brokers.redis import RedisBroker
from tasks.task_1 import task_1

redis_broker = RedisBroker(url='redis://redis.xxxxxxx/10')
dramatiq.set_broker(redis_broker)

@dramatiq.actor(max_retries = 0)
def handle_task(data, session_url):
    result = task_1(data, session_url)
  1. I start both Sanic and Dramatiq with PM2, but separately. However, I find that Dramatiq cannot receive messages sent from Sanic, even with the official demo.
apps:
  - name: sanic
    script: sanic
    args: server:app --fast
    cwd: /app/current/app
    interpreter: python3
    instances: 1
    autorestart: true
    watch: false
    max_restarts: 5
    restart_delay: 5000
    log_date_format: YYYY-MM-DD HH:mm:ss
    log_file: /app/shared/log/root.log
    error_file: /app/shared/log/error.log
    env:
      SANIC_ENV: production
apps:
  - name: dramatiq
    script: dramatiq
    args: dramatiq dramatiq_tasks -p 1 -t 1 --log-file /app/shared/log/dramatiq.log
    cwd: /app/current/app
    interpreter: python3
    instances: 1
    autorestart: true
    watch: false
    max_restarts: 5
    restart_delay: 5000
    log_date_format: YYYY-MM-DD HH:mm:ss
    env:
      SANIC_ENV: production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant