'why could not debugging the python celery in PyCharm
I am trying to debugging the celery in PyCharm, when I start the celery in PyCharm the task did not trigger the breakpoint. This is the PyCharm config look like:
and this is the log output:
/Users/xiaoqiangjiang/source/reddwarf/backend/pydolphin/venv/bin/python "/Users/xiaoqiangjiang/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/221.5080.212/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py" --module --multiprocess --qt-support=auto --client 127.0.0.1 --port 49569 --file celery -A dolphin.tasks.tasks worker --loglevel=INFO -n non-editor-pick-and-non-diff-pull-worker -Q non-editor-pick-and-non-diff-pull --concurrency 1
Connected to pydev debugger (build 221.5080.212)
-------------- celery@rss-article-worker v5.1.2 (sun-harmonics)
--- ***** -----
-- ******* ---- macOS-12.3.1-arm64-arm-64bit 2022-05-11 22:05:37
- *** --- * ---
- ** ---------- [config]
- ** ---------- .> app: tasks:0x104f69630
- ** ---------- .> transport: redis://default:**@cruise-redis-master.reddwarf-cache.svc.cluster.local:6379/5
- ** ---------- .> results: redis://default:**@cruise-redis-master.reddwarf-cache.svc.cluster.local:6379/5
- *** --- * --- .> concurrency: 1 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** -----
-------------- [queues]
.> non-editor-pick-and-non-diff-pull exchange=non-editor-pick-and-non-diff-pull(direct) key=non-editor-pick-and-non-diff-pull
[tasks]
. pydolphin.dolphin.tasks.cert-tasks
. pydolphin.dolphin.tasks.tasks
[2022-05-11 22:05:37,970: INFO/MainProcess] Connected to redis://default:**@cruise-redis-master.reddwarf-cache.svc.cluster.local:6379/5
[2022-05-11 22:05:38,138: INFO/MainProcess] mingle: searching for neighbors
[2022-05-11 22:05:39,436: INFO/MainProcess] mingle: all alone
[2022-05-11 22:05:39,730: INFO/MainProcess] celery@rss-article-worker ready.
the debugger process running fine and no error output. But the tasks seems did not trigger. I am sure the connection string was right. the task queue non-editor-pick-and-non-diff-pull
in Redis is not null, why did not fire the breakpoint? Am I missing something? I also tried to copy the same command to the terminal, and it could successfully fetch tasks from Redis and trigger the task, why could not run task in the PyCharm? This command works fine in terminal:
celery -A dolphin.tasks.tasks worker \
--loglevel=WARNING -n non-editor-pick-and-non-diff-pull-worker \
-Q non_editor_pick_and_non_diff_pull --concurrency 1
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|