Very slow pycharm and app engine debug startup

Answered

When running debug on my app engine config it takes around 3 minutes to start. In an earlier version of pycharm with exactly the same repo it takes only a couple of seconds also my colleagues environment with the exact same pycharm version and repo only takes a few seconds.

I am worried that there is some caching issue (or lack there of).

 

When running with `PYCHARM_DEBUG=True`  I receive two threads dev_appserver.py being instantiated which just hang for 3 mins.

After the slow dispatch everything works perfectly and very fast. 

Config

this is the log until the 3-5 min hang

 

this is the the log before the 3-5 min hang with `PYCHARM_DEBUG=True`

/virtualenvs/property/bin/python /Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py --multiproc --client 127.0.0.1 --port 49600 --file /google-cloud-sdk/bin/dev_appserver.py --port 8080 --host 127.0.0.1 .
Using Cython speedups
Executing file /google-cloud-sdk/bin/dev_appserver.py
arguments: ['/google-cloud-sdk/bin/dev_appserver.py', '--port', '8080', '--host', '127.0.0.1', '.']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '49600')
('Connected.',)
debugger: received >>99 -1 49601
<<
Received command: ??? 99 -1 49601

Received port 49601

pydev debugger: process 1532 is connecting

Connected to pydev debugger (build 183.4284.139)
('Connecting to ', '127.0.0.1', ':', '49601')
('Connected.',)
debugger: received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX

sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
debugger: received >>122 3 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 3 python-BaseException None None 0 1 0

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108164248>}

debugger: received >>122 7 django-VariableDoesNotExist
146 9 SHOW_RETURN_VALUES 1
101 5
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 7 django-VariableDoesNotExist

Received command: CMD_SHOW_RETURN_VALUES 146 9 SHOW_RETURN_VALUES 1

Show return values: True

Received command: CMD_RUN 101 5

IDE_PROJECT_ROOTS ['/property']

('Connecting to ', '127.0.0.1', ':', '49600')
('Connected.',)
debugger: received >>99 -1 49605
<<
Received command: ??? 99 -1 49605

sending cmd --> CMD_PROCESS_CREATED 149 2 <process/>
PYDEVD_FILTER_LIBRARIES False

('Connecting to ', '127.0.0.1', ':', '49605')
('Connected.',)
debugger: received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX

sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
debugger: received >>122 3 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 3 python-BaseException None None 0 1 0

debugger: received >>122 11 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 11 python-BaseException None None 0 1 0

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108b5a758>}

debugger: received >>101 7
122 5 django-VariableDoesNotExist
146 9 SHOW_RETURN_VALUES 1
<<
Received command: CMD_RUN 101 7

Received command: CMD_ADD_EXCEPTION_BREAK 122 5 django-VariableDoesNotExist

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x1081641b8>}

debugger: received >>122 13 django-VariableDoesNotExist
146 15 SHOW_RETURN_VALUES 1
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 13 django-VariableDoesNotExist

Received command: CMD_SHOW_RETURN_VALUES 146 15 SHOW_RETURN_VALUES 1

Show return values: True

Received command: CMD_SHOW_RETURN_VALUES 146 9 SHOW_RETURN_VALUES 1

Show return values: True

Patching args: ['/virtualenvs/property/bin/python', '/google-cloud-sdk/platform/google_appengine/dev_appserver.py', '--skip_sdk_update_check=True', '--datastore_emulator_cmd=/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator', '--port', '8080', '--host', '127.0.0.1', '.']
Patching args: ['/virtualenvs/property/bin/python', '/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py', '--port', '49600', '--client', '127.0.0.1', '--DEBUG_RECORD_SOCKET_READS', '--multiproc', '--file', '/google-cloud-sdk/platform/google_appengine/dev_appserver.py', '--skip_sdk_update_check=True', '--datastore_emulator_cmd=/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator', '--port', '8080', '--host', '127.0.0.1', '.']
Using Cython speedups
Executing file /google-cloud-sdk/platform/google_appengine/dev_appserver.py
arguments: ['/google-cloud-sdk/platform/google_appengine/dev_appserver.py', '--skip_sdk_update_check=True', '--datastore_emulator_cmd=/google-cloud-sdk/platform/cloud-datastore-emulator/cloud_datastore_emulator', '--port', '8080', '--host', '127.0.0.1', '.']
PYDEVD_FILTER_LIBRARIES False

Started in multiproc mode

('Connecting to ', '127.0.0.1', ':', '49600')
('Connected.',)
debugger: received >>99 -1 49608
<<
Received command: ??? 99 -1 49608

Received port 49608

pydev debugger: process 1542 is connecting

('Connecting to ', '127.0.0.1', ':', '49608')
('Connected.',)
debugger: received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX

sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
debugger: received >>122 3 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 3 python-BaseException None None 0 1 0

debugger: received >>122 17 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 17 python-BaseException None None 0 1 0

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108eb08c0>}

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108b3fb90>}

debugger: received >>122 5 django-VariableDoesNotExist
146 9 SHOW_RETURN_VALUES 1
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 5 django-VariableDoesNotExist
debugger: received >>122 19 django-VariableDoesNotExist
146 21 SHOW_RETURN_VALUES 1
<<

Received command: CMD_ADD_EXCEPTION_BREAK 122 19 django-VariableDoesNotExist

Received command: CMD_SHOW_RETURN_VALUES 146 21 SHOW_RETURN_VALUES 1

Show return values: True

Received command: CMD_SHOW_RETURN_VALUES 146 9 SHOW_RETURN_VALUES 1

Show return values: True

debugger: received >>101 7
<<
Received command: CMD_RUN 101 7

IDE_PROJECT_ROOTS ['/property']

('Connecting to ', '127.0.0.1', ':', '49600')
('Connected.',)
debugger: received >>99 -1 49611
<<
Received command: ??? 99 -1 49611

sending cmd --> CMD_PROCESS_CREATED 149 2 <process/>
PYDEVD_FILTER_LIBRARIES False

('Connecting to ', '127.0.0.1', ':', '49611')
('Connected.',)
debugger: received >>501 1 0.1 UNIX
<<
Received command: CMD_VERSION 501 1 0.1 UNIX

sending cmd --> CMD_VERSION 501 1 @@BUILD_NUMBER@@
debugger: received >>122 23 python-BaseException None None 0 1 0
<<
debugger: received >>122 3 python-BaseException None None 0 1 0
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 23 python-BaseException None None 0 1 0

Received command: CMD_ADD_EXCEPTION_BREAK 122 3 python-BaseException None None 0 1 0

debugger: received >>122 11 python-BaseException None None 0 1 0
<<
Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108164248>}

Received command: CMD_ADD_EXCEPTION_BREAK 122 11 python-BaseException None None 0 1 0

debugger: received >>146 25 SHOW_RETURN_VALUES 1
122 27 django-VariableDoesNotExist
<<
Received command: CMD_SHOW_RETURN_VALUES 146 25 SHOW_RETURN_VALUES 1

Show return values: True

Received command: CMD_ADD_EXCEPTION_BREAK 122 27 django-VariableDoesNotExist

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108eb0830>}

Exceptions to hook on terminate: {u'BaseException': <_pydevd_bundle.pydevd_breakpoints.ExceptionBreakpoint instance at 0x108f2c2d8>}

debugger: received >>122 13 django-VariableDoesNotExist
146 15 SHOW_RETURN_VALUES 1
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 13 django-VariableDoesNotExist

debugger: received >>122 5 django-VariableDoesNotExist
101 7
146 9 SHOW_RETURN_VALUES 1
<<
Received command: CMD_ADD_EXCEPTION_BREAK 122 5 django-VariableDoesNotExist

Received command: CMD_SHOW_RETURN_VALUES 146 15 SHOW_RETURN_VALUES 1

Show return values: True

Received command: CMD_RUN 101 7

Received command: CMD_SHOW_RETURN_VALUES 146 9 SHOW_RETURN_VALUES 1

Show return values: True

sending cmd --> CMD_THREAD_CREATE 103 4 <xml><thread name="MainThread" id="pid_1532_id_4414722192" /></xml>
sending cmd --> CMD_THREAD_CREATE 103 4 <xml><thread name="MainThread" id="pid_1542_id_4428650320" /></xml>

 

5 comments

Please try removing Django Exception Breakpoint and see if problem remains.

0

I have filed an issue to our issue tracker https://youtrack.jetbrains.com/issue/PY-32982, please follow it for updates.

0

Please sign in to leave a comment.