Obsolete
Status Update
Comments
jo...@google.com <jo...@google.com> #2
This is indeed strange. I'm testing Python SDK 1.9.37 as well and I don't see the same thing. I'm on Debian though, Python 2.7.9, Kernel 3.16.0-4. Here's an example of my sys.path, SDK installed to '/opt/devel/google/appengine/python':
['/opt/devel/google/appengine/python', '/usr/lib/python2.7', '/usr/lib/python2.7/lib-dynload', '/opt/devel/google/appengine/python/lib/protorpc-1.0', '/opt/devel/google/appengine/python/lib/webapp2-2.3', '/opt/devel/google/appengine/python/lib/webob-1.1.1', '/opt/devel/google/appengine/python/lib/yaml-3.10']
Could you share which Python version you're on, and also the method you're testing (I assume just a one-line get handler that prints sys.path)?
['/opt/devel/google/appengine/python', '/usr/lib/python2.7', '/usr/lib/python2.7/lib-dynload', '/opt/devel/google/appengine/python/lib/protorpc-1.0', '/opt/devel/google/appengine/python/lib/webapp2-2.3', '/opt/devel/google/appengine/python/lib/webob-1.1.1', '/opt/devel/google/appengine/python/lib/yaml-3.10']
Could you share which Python version you're on, and also the method you're testing (I assume just a one-line get handler that prints sys.path)?
jo...@gmail.com <jo...@gmail.com> #3
I have a similar issue; running Python 2.7.11 (from homebrew) on Mac OS 10.11.3.
Description
This issue makes some of our tests either brittle or simply totally non-functional.
Lots of sequential puts and gets can cause the datastore to fail on read, which I guess is fine since the datastore in production tends to fail after a few hundred sequential ops anyways. The devappserver itself does NOT crash, but simply kicks back an error on datastore read.
However... I can *crash* the devappserver by by poking at it concurrently. (see attached file for a reproducing test case).
It claims to be running out of file handles... which is weird since I set my system ulimit to unlimited. Yet it still exhibits the issue. It crashes in the bowels of the python glue for the go appengine development server. We can't code around this in our tests.
Gae-Go
OSX Mavericks 10.9.3
Google Cloud SDK 0.9.27
app-engine-go-darwin-x86_64 1.9.6
gae-python 2014.05.06
gae-python-launcher-mac 1.9.6
Here is a sanitized traceback. You can get these to happen simply by running the attached test code a few times using
"goapp test -v crashdevappserver --test.run=TestConcurrentFileHandleExhaustion":
Exception in thread Thread-1:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 140, in _loop_forever
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 162, in _select
File "google-cloud-sdk/platform/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1887, in tick
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 202, in accept
error: [Errno 24] Too many open files
Exception in thread Thread-7:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 808, in __bootstrap_inner
self.run()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 761, in run
self.__target(*self.__args, **self.__kwargs)
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1403, in _loop_adjusting_instances
self._adjust_instances()
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1380, in _adjust_instances
self._add_instance(permit_warmup=True)
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1258, in _add_instance
expect_ready_request=perform_warmup)
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/go_runtime.py", line 165, in new_instance
if self._go_application.maybe_build(self._modified_since_last_build):
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/go_application.py", line 259, in maybe_build
self._extras_hash, old_extras_hash = (self._get_extras_hash(),
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/go_application.py", line 192, in _get_extras_hash
env={})
File "google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/safe_subprocess.py", line 74, in start_process
stdin=subprocess.PIPE, startupinfo=startupinfo)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 703, in __init__
errread, errwrite) = self._get_handles(stdin, stdout, stderr)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1100, in _get_handles
p2cread, p2cwrite = self.pipe_cloexec()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1153, in pipe_cloexec
r, w = os.pipe()
OSError: [Errno 24] Too many open files