teepark / greenhouse

non-blocking IO with coroutines to mimic blocking IO with threads
BSD 3-Clause "New" or "Revised" License
35 stars 5 forks source link

select.kqueue patching fails with recursion error. #5

Closed dsully closed 12 years ago

dsully commented 12 years ago

Running straight ouf of Github, trying to patch while running Tornado. If I try to just patch the 'select' module:

This is on OS X 10.8.1

$ process-deployment-queue -n -f esv4
[MainThread     ] [INFO] 2012-09-02 21:09:13,307 - Initializing v1.4.4 ...
[MainThread     ] [INFO] 2012-09-02 21:09:13,307 - Initializing DeploymentSessionManager..
[MainThread     ] [INFO] 2012-09-02 21:09:13,307 - Setting current state to: available
[MainThread     ] [ERROR] 2012-09-02 21:09:13,312 - maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):
  File "/Users/dsully/dev/tools/lib/utils/src/test/cli/__init__.py", line 400, in run
    yield self
  File "/Users/dsully/dev/tools/apps/deployment/bin/process-deployment-queue", line 171, in main
    server = create_server(http_port)
  File "/Users/dsully/dev/tools/lib/deployment/src/test/deployment/session/server.py", line 223, in create_server
    http_server.listen(port)
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/tornado/netutil.py", line 104, in listen
    self.add_sockets(sockets)
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/tornado/netutil.py", line 116, in add_sockets
    self.io_loop = IOLoop.instance()
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/tornado/ioloop.py", line 151, in instance
    IOLoop._instance = IOLoop()
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/tornado/ioloop.py", line 111, in __init__
    self._impl = impl or _poll()
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/tornado/ioloop.py", line 546, in __init__
    self._kqueue = select.kqueue()
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/greenhouse/emulation/select.py", line 123, in __init__
    self._kqueue = select.kqueue()
  File "/Users/dsully/.virtualenvs/test/lib/python2.6/site-packages/greenhouse/emulation/select.py", line 123, in __init__
    self._kqueue = select.kqueue()
...
RuntimeError: maximum recursion depth exceeded while calling a Python object
teepark commented 12 years ago

fixed in d5fd7cc214cad6dacf6da5e4246d69b058a63223

can you confirm? I don't have an OSX machine to test on -- I had a FreeBSD VM for a while, may have to get one going again for this purpose.

dsully commented 12 years ago

Yes, that fix works. With this and the other fixes in the past day, Tornado appears to be running fine under greenhouse patching.

Having VMs around for this is a good thing, I've found.