Difference between revisions of "User:Baba Yamamoto/Eventlet"

From Second Life Wiki
Jump to navigation Jump to search
(New page: Been working on getting Eventlet working under windows for a little bit now. Issues: * <strike>Can't build Greenlet</strike> ** Aquired VS 2003 and built greenlet. Created windist instal...)
 
(added test results)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
Been working on getting Eventlet working under windows for a little bit now.  
Been working on getting [[Eventlet]] working under windows for a little bit now.  Both examples work.


Issues:
Issues:
* <strike>Can't build Greenlet</strike>
* Greenlet has C extensions which require vs 2003.
** Aquired VS 2003 and built greenlet. Created windist installer.
** Aquired VS 2003 and built greenlet. Created windist installer.
* util.py has dependency fcntl which is unix only.
** Commented this out and Eventlet works ok. Probably not a workable solution.
* httpc.py has a dependency on mx.DateTime
** Part of [http://www.egenix.com/products/python/mxBase/ mxBase]. Installers for all platforms available.


* utils.py uses fcntl which is unix only.
 
== Tests ==
=== httpd tests ===
test_004_close_keepalive fails only when running repeatedly in a short period of time.<br />
test_005_run_apachebench always fails.
 
<pre>
C:\Python25\Lib\eventlet>httpd_test.py
httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.0" 200 11 0.000000
.httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.016000
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.000000
.httpd starting up on ('0.0.0.0', 12346)
.httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.000000
EE
======================================================================
ERROR: test_004_close_keepalive (__main__.TestHttpd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python25\Lib\eventlet\httpd_test.py", line 122, in test_004_close_keepalive
    ('127.0.0.1', 12346))
  File "C:\Python25\lib\eventlet\api.py", line 96, in connect_tcp
    desc.connect(address)
  File "C:\Python25\lib\eventlet\wrappedfd.py", line 142, in connect
    while not connect(fd, address):
  File "C:\Python25\lib\eventlet\util.py", line 77, in socket_connect
    raise socket.error(err, errno.errorcode[err])
error: (10022, 'WSAEINVAL')
 
======================================================================
ERROR: test_005_run_apachebench (__main__.TestHttpd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python25\Lib\eventlet\httpd_test.py", line 134, in test_005_run_apachebench
    out = processes.Process('/usr/sbin/ab', ['-c','64','-n','1024', '-k', url])
  File "C:\Python25\lib\eventlet\processes.py", line 45, in __init__
    self.run()
  File "C:\Python25\lib\eventlet\processes.py", line 53, in run
    self.popen4 = popen2.Popen4([self.command] + self.args)
AttributeError: 'module' object has no attribute 'Popen4'
 
----------------------------------------------------------------------
Ran 5 tests in 0.250s
 
FAILED (errors=2)
</pre>
 
===API Tests===
Some issues also with the api tests.
<pre>
C:\Python25\Lib\eventlet>api_test.py
..Traceback (most recent call last):
  File "C:\Python25\lib\eventlet\selecthub.py", line 169, in wait
    observed[fileno](fileno)
  File "C:\Python25\lib\eventlet\api.py", line 143, in cb
    greenlib.switch(self, fd)
  File "C:\Python25\lib\eventlet\greenlib.py", line 310, in switch
    rval = other.switch(value, exc)
  File "C:\Python25\lib\eventlet\greenlib.py", line 287, in greenlet_body
    return cb(*args)
  File "C:\Python25\lib\eventlet\api.py", line 156, in _spawn_startup
    return cb(*args, **kw)
  File "C:\Python25\lib\eventlet\api.py", line 96, in connect_tcp
    desc.connect(address)
  File "C:\Python25\lib\eventlet\wrappedfd.py", line 142, in connect
    while not connect(fd, address):
  File "C:\Python25\lib\eventlet\util.py", line 77, in socket_connect
    raise socket.error(err, errno.errorcode[err])
error: (10022, 'WSAEINVAL')
Removing descriptor: 316
connected
connected
Traceback (most recent call last):
  File "C:\Python25\lib\eventlet\selecthub.py", line 169, in wait
    observed[fileno](fileno)
  File "C:\Python25\lib\eventlet\api.py", line 143, in cb
    greenlib.switch(self, fd)
  File "C:\Python25\lib\eventlet\greenlib.py", line 307, in switch
    raise SwitchingToDeadGreenlet("Switching to dead greenlet %r %r %r" % (other, value, exc))
SwitchingToDeadGreenlet: Switching to dead greenlet <greenlet.greenlet object at
0x00EBE980> <socket._socketobject object at 0x00EBDAB0> None
Removing descriptor: 340
...
----------------------------------------------------------------------
Ran 5 tests in 0.172s
 
OK
</pre>
 
===Pools Tests===
pools tests good
<pre>
C:\Python25\Lib\eventlet>pools_test.py
.........
----------------------------------------------------------------------
Ran 9 tests in 0.063s
 
OK
</pre>
===Timer Tests===
timer tests good
<pre>
C:\Python25\Lib\eventlet>timer_test.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.016s
 
OK
</pre>

Latest revision as of 12:53, 17 September 2007

Been working on getting Eventlet working under windows for a little bit now. Both examples work.

Issues:

  • Greenlet has C extensions which require vs 2003.
    • Aquired VS 2003 and built greenlet. Created windist installer.
  • util.py has dependency fcntl which is unix only.
    • Commented this out and Eventlet works ok. Probably not a workable solution.
  • httpc.py has a dependency on mx.DateTime
    • Part of mxBase. Installers for all platforms available.


Tests

httpd tests

test_004_close_keepalive fails only when running repeatedly in a short period of time.
test_005_run_apachebench always fails.

C:\Python25\Lib\eventlet>httpd_test.py
httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.0" 200 11 0.000000
.httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.016000
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.000000
.httpd starting up on ('0.0.0.0', 12346)
.httpd starting up on ('0.0.0.0', 12346)
127.0.0.1 - - [17/Sep/2007 13:28:42] "GET / HTTP/1.1" 200 11 0.000000
EE
======================================================================
ERROR: test_004_close_keepalive (__main__.TestHttpd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python25\Lib\eventlet\httpd_test.py", line 122, in test_004_close_keepalive
    ('127.0.0.1', 12346))
  File "C:\Python25\lib\eventlet\api.py", line 96, in connect_tcp
    desc.connect(address)
  File "C:\Python25\lib\eventlet\wrappedfd.py", line 142, in connect
    while not connect(fd, address):
  File "C:\Python25\lib\eventlet\util.py", line 77, in socket_connect
    raise socket.error(err, errno.errorcode[err])
error: (10022, 'WSAEINVAL')

======================================================================
ERROR: test_005_run_apachebench (__main__.TestHttpd)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python25\Lib\eventlet\httpd_test.py", line 134, in test_005_run_apachebench
    out = processes.Process('/usr/sbin/ab', ['-c','64','-n','1024', '-k', url])
  File "C:\Python25\lib\eventlet\processes.py", line 45, in __init__
    self.run()
  File "C:\Python25\lib\eventlet\processes.py", line 53, in run
    self.popen4 = popen2.Popen4([self.command] + self.args)
AttributeError: 'module' object has no attribute 'Popen4'

----------------------------------------------------------------------
Ran 5 tests in 0.250s

FAILED (errors=2)

API Tests

Some issues also with the api tests.

C:\Python25\Lib\eventlet>api_test.py
..Traceback (most recent call last):
  File "C:\Python25\lib\eventlet\selecthub.py", line 169, in wait
    observed[fileno](fileno)
  File "C:\Python25\lib\eventlet\api.py", line 143, in cb
    greenlib.switch(self, fd)
  File "C:\Python25\lib\eventlet\greenlib.py", line 310, in switch
    rval = other.switch(value, exc)
  File "C:\Python25\lib\eventlet\greenlib.py", line 287, in greenlet_body
    return cb(*args)
  File "C:\Python25\lib\eventlet\api.py", line 156, in _spawn_startup
    return cb(*args, **kw)
  File "C:\Python25\lib\eventlet\api.py", line 96, in connect_tcp
    desc.connect(address)
  File "C:\Python25\lib\eventlet\wrappedfd.py", line 142, in connect
    while not connect(fd, address):
  File "C:\Python25\lib\eventlet\util.py", line 77, in socket_connect
    raise socket.error(err, errno.errorcode[err])
error: (10022, 'WSAEINVAL')
Removing descriptor: 316
connected
connected
Traceback (most recent call last):
  File "C:\Python25\lib\eventlet\selecthub.py", line 169, in wait
    observed[fileno](fileno)
  File "C:\Python25\lib\eventlet\api.py", line 143, in cb
    greenlib.switch(self, fd)
  File "C:\Python25\lib\eventlet\greenlib.py", line 307, in switch
    raise SwitchingToDeadGreenlet("Switching to dead greenlet %r %r %r" % (other, value, exc))
SwitchingToDeadGreenlet: Switching to dead greenlet <greenlet.greenlet object at
 0x00EBE980> <socket._socketobject object at 0x00EBDAB0> None
Removing descriptor: 340
...
----------------------------------------------------------------------
Ran 5 tests in 0.172s

OK

Pools Tests

pools tests good

C:\Python25\Lib\eventlet>pools_test.py
.........
----------------------------------------------------------------------
Ran 9 tests in 0.063s

OK

Timer Tests

timer tests good

C:\Python25\Lib\eventlet>timer_test.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.016s

OK