'why the PyCharm did not hit the breakpoint when debugging celery

I want to debugging the celery(celery==5.1.2) task in PyCharm(PyCharm 2021.3.1 (Professional Edition)) right now. So I configure the PyCharm debugging like this:

enter image description here

then I start debbuging in PyCharm, everything works fine, the log output look like this:

[2022-01-02 23:33:08,510: INFO/MainProcess] Connected to redis://default:**@cruise-redis-master.reddwarf-cache.svc.cluster.local:6379/5
[2022-01-02 23:33:08,591: INFO/MainProcess] mingle: searching for neighbors
[2022-01-02 23:33:09,836: INFO/MainProcess] mingle: sync with 3 nodes
[2022-01-02 23:33:09,837: INFO/MainProcess] mingle: sync complete
[2022-01-02 23:33:10,172: INFO/MainProcess] celery@cert-notify-worker ready.
[2022-01-02 23:34:00,151: INFO/MainProcess] Task pydolphin.dolphin.tasks.cert-tasks[37b61cc4-a0ee-4655-9ef2-2fc4e0a82fb7] received
[2022-01-02 23:35:00,129: INFO/MainProcess] Task pydolphin.dolphin.tasks.cert-tasks[33b1df93-3cec-4a67-9489-3c8a132ea443] received
[2022-01-02 23:37:00,085: INFO/MainProcess] Task pydolphin.dolphin.tasks.cert-tasks[b9d0845c-e158-49db-a1e0-56a399607f9d] received

but the problem is that the PyCharm did not going to hit the breakpoint, why the IDE did not stop in breakpoint? what should I do to make the breakpoint take effect? Am I missing some configuration? BTW, my os was macOS Monterey. I have already set Settings > Python Debugger > Gevent compatible debugging. I also tried using Visual Studio Code, this is the config:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Celery",
            "type": "python",
            "request": "launch",
            "module": "celery",
            "console": "integratedTerminal",
            "args": [
                "-A",
                "dolphin.tasks.tasks",
                "worker",
                "-l",
                "info",
                "-P",
                "solo",
                "-Q",
                "non-editor-pick-and-non-diff-pull"
            ]
        }
    ]
}

still did not trigger the breakpoint in visual studio code.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source