PyCharm Professional debugger has one issue when working with Google App Engine. Breakpoints do not work when debugging Threads launched manually by my code.
This affects ability to debug code running on dev_appserver
which uses threading.Thread
or concurrent.futures.ThreadPoolExecutor
2.7 backport (which is officially supported by GAE now)
The issue occurs both in PyCharm 2017.2 and 2017.3.4. Observed on GAE SDK 1.9.66 on Ubuntu Linux.
Here is a repro code - call this from any request handler.
from concurrent.futures import ThreadPoolExecutor, wait
from threading import Thread
def worker():
logging.info("Worker") # set breakpoint here
time.sleep(3)
def call_this(): # call this from your request handler
tpe = ThreadPoolExecutor(max_workers=5)
futures = [tpe.submit(worker) for i in range(10)]
wait(futures)
threads = [Thread(worker) for i in range(10)]
for t in threads: t.start()
for t in threads: t.join()