0

I'm developing a cassandra storage finder for graphite-api. graphite-api is installed via pip and run via gunicorn so I can't just call the script with a debugger but want to use interactive debugging.

When I import pdb in my storage finder and set a breakpoint, the code will halt there, but how can I connect now to the headless running pdb in the script? Or is my approach to this debugging problem the wrong one and this has to be done in a completely other way?

Smittey
  • 2,475
  • 10
  • 28
  • 35
fxk8y
  • 5
  • 4

1 Answers1

1

pdb gives control over to gunicorn, which is not what you want. Have a look at rpdb or other remote debugging solutions.

Aske Doerge
  • 1,331
  • 10
  • 17
  • 2
    rpdb was exactly what I was searching for. I looked at a few python remote debugging pages but none of them seemed to give me a useful remote debugging solution. rpdb halts the whole gunicorn worker process when running into rpdb.set_trace() and then I'm able to connect via netcat and start debugging. Useful information for any other user searching for this, you have to start gunicorn with a very high value for --timeout parameter because it kills hanging worker processes after 30secods – fxk8y Nov 23 '15 at 13:12