我在同一个实例上出现了这个错误 20 次,然后在实例被杀死后它就消失了,因为处理了太多的顺序错误。我的代码没有进行任何更改,这是我唯一一次看到这种情况发生。
问题:
- 我的代码中的什么类型的问题可能导致这种情况仅在某些情况下发生?我不知道从哪里开始寻找,因为我无法重现问题。
- 有没有办法减少实例在被杀死之前允许的顺序错误的数量,这样如果再次发生就不会造成太大的破坏?
这是我从这个实例中获得的第一个日志(没有错误):
2012-10-05 18:41:03.266 /rpc/?action=ServerAvailable 500 60908ms 0kb popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2
98.207.195.103 - - [05/Oct/2012:11:41:03 -0700] "GET /rpc/?action=ServerAvailable HTTP/1.1" 500 0 - "popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2" "www.popwordsapp.appspot.com" ms=60909 cpu_ms=498 loading_request=1 instance=00c61b117c8f8b7f701c0776284c25a64c7ff329
I 2012-10-05 18:41:03.265
This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.
这是此实例的下一个日志(第一个有错误):
2012-10-05 18:49:38.704 /rpc/?action=ServerAvailable 500 867ms 0kb popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2
98.207.195.103 - - [05/Oct/2012:11:49:38 -0700] "GET /rpc/?action=ServerAvailable HTTP/1.1" 500 0 - "popwords/1.2 CFNetwork/548.1.4 Darwin/11.4.2" "www.popwordsapp.appspot.com" ms=867 cpu_ms=86 instance=00c61b117c8f8b7f701c0776284c25a64c7ff329
E 2012-10-05 18:49:38.103
Traceback (most recent call last):
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 195, in Handle
handler = _config_handle.add_wsgi_middleware(self._LoadHandler())
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 239, in _LoadHandler
handler = __import__(path[0])
File "/base/data/home/apps/s~popwordsapp/1.362183705604897547/main.py", line 40, in <module>
from google.appengine.ext import db
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/ext/db/__init__.py", line 98, in <module>
from google.appengine.api import datastore
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/datastore.py", line 62, in <module>
from google.appengine.datastore import datastore_query
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_query.py", line 64, in <module>
from google.appengine.datastore import datastore_index
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/datastore/datastore_index.py", line 62, in <module>
from google.appengine.api import yaml_object
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/yaml_object.py", line 36, in <module>
from google.appengine.api import yaml_listener
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/yaml_listener.py", line 34, in <module>
yaml.events.StreamStartEvent: 'StreamStart',
AttributeError: 'module' object has no attribute 'events'
在这两个日志之间有一个日志,其中创建了一个额外的实例(没有错误)。没有一个错误来自在第一个实例之后立即创建的另一个实例。由于处理了太多的顺序错误,它在第一个实例被杀死后开始成功处理请求。