Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to debug code on pycharm as gunicorn worker times out

Whenever I try to test & debug my api functions on pycharm, this error pops up and the gunicorn server restarts. Is there any workaround for this?

[2018-12-26 12:47:16 +0000] [13596] [CRITICAL] WORKER TIMEOUT (pid:14527)
Traceback (most recent call last):
  File "_pydevd_bundle/pydevd_cython.pyx", line 750, in _pydevd_bundle.pydevd_cython.PyDBFrame.trace_dispatch
    self.do_wait_suspend(thread, frame, event, arg)
  File "_pydevd_bundle/pydevd_cython.pyx", line 254, in _pydevd_bundle.pydevd_cython.PyDBFrame.do_wait_suspend
    self._args[0].do_wait_suspend(*args, **kwargs)
  File "/opt/pycharm-community-2018.3.2/helpers/pydev/pydevd.py", line 877, in do_wait_suspend
    time.sleep(0.01)
  File "/home/bhargav/.venvs/icv/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 196, in handle_abort
    sys.exit(1)
SystemExit: 1
like image 612
Bhargav Raju Avatar asked Sep 20 '25 14:09

Bhargav Raju


1 Answers

run your app with time out param e.g.

gunicorn -b 0.0.0.0:5000 --log-level=debug -t 300 for 5 mins

gunicorn doc

like image 65
as - if Avatar answered Sep 22 '25 06:09

as - if