[Twisted-Python] documentation / kqueue / feedback

Dr aio dr.pythoniac at googlemail.com
Wed Apr 16 11:42:08 EDT 2008


First: THANKS for reacting so friendly and civilized :)

Cliff
> Have you tried the finger tutorial.

Sure. When I say, I DID read what's available, then I did. Otherwise I
wouldn't dare to complain.


Thomas Hervé <therve at free.fr> wrote:

> ...
> > - How about getting 1 version of pykqueue properly running and into TM ?
>
> The current one is grossly working, even though there are some
> problems, and that the setup is not triavial. But a new reactor has
> been developed, using Python 2.6 KQueue wrapper, and should be
> available some day. See http://twistedmatrix.com/trac/ticket/1918 for
> the progress on this field. Any tests and feedback would help this
> going further.

Great. Thanks. PLEASE test it properly and prepare a reasonably conmplete
readme at least.
And kindly see below for my current problems.


mike at mkp.ca wrote:

> Feel better now? ;-)
>
> I understand your pain. Twisted is very much written by hackers for
> hackers, with the old school practices of source and oral tradition in
> place of documentation. It took me many attempts before I felt I was
> competent, and I still can't do anything without constantly consulting
> the source code. I confess, I haven't bothered to look at the docs
> for years, and I suspect it is the same with the core Twisted
> developers.
>
> Life is made easier by having a mentor who can look over your work and
> point out misunderstandings and antipatterns. I find the mailing list
> to be a mixed bag as a replacement. Sometimes you get real gems from
> Glyph and company, and sometimes you just get a hard time. I'd be
> happy to help if I can, but any deep thinking will probably have to
> wait for weekends. I'm also a long time FreeBSD user and Python
> developer.
>
> Hope you make it over the curve!

Thanks, Mike, for your friendly welcome.

Yes, I do understand that attitude. I love to have it, too.
BUT: twisted is having and looking for sponsors, that is, twisted is -
gladly ! - meant to be a product and not some hackers private delight
(only).

You see, I argue for using twisted. Possibly some of us argue against other
solutions and, worst case, they risk their ass doing so.
Again, I share your attitude and i understand it so well. But, PLEASE,
understand that I need to get sth. working, that some colleagues put a lot
of trust, valuable trust, into twisted, even taking a risk. That should be
seen and properly respnonded to, too.

I'm not talking about script kiddies. I'm talking about seasoned colleages
with a (couple) dozend years in the job.
We don't need pampering, not even mentoring, practical and welcome as that
might be. We need realiabilty and a _fair_ chance to find our ways in
twisted. A reasonable starting point.

--------

Here's what I tried today:

Using py-kqueue (1.4) in FreeBSDs ports.

'twistd -r kqueue -no -f web.tap' works fine.
'twistd -r kqueue -f web tap' breaks.

Next I checked, wether the changes proposed by IST where in version 1.4.
Nope.
So I edited them into the patch that comes with the port anyway
(patch-kqsyscallmodule).
If anyone is interested, I'll post it.

Same as without, i.e. it works but it breaks if run as daemon.
Here's what I find in the log:

Log opened.
twistd 2.5.0 (/usr/local/bin/python2.5 2.5.2) starting up
reactor class: <class 'twisted.internet.kqreactor.KQueueReactor'>
Loading web.tap...
Loaded.
Changing process name to test
Log opened.
twistd 2.5.0 (/home/www/tm/ 2.5.2) starting up
reactor class: <class 'twisted.internet.kqreactor.KQueueReactor'>
Loading web.tap...
Loaded.
twisted.web.server.Site starting on 80
Starting factory <twisted.web.server.Site instance at 0x85935ec>
Traceback (most recent call last):
File "/usr/local/bin/twistd", line 21, in <module>
run()
File "/usr/local/lib/python2.5/site-packages/twisted/scripts/twistd.py",
line 27, in run
app.run(runApp, ServerOptions)
File "/usr/local/lib/python2.5/site-packages/twisted/application/app.py",
line 379, in run
runApp(config)
File "/usr/local/lib/python2.5/site-packages/twisted/scripts/twistd.py",
line 23, in runApp
_SomeApplicationRunner(config).run()
File "/usr/local/lib/python2.5/site-packages/twisted/application/app.py",
line 158, in run
self.postApplication()
File
"/usr/local/lib/python2.5/site-packages/twisted/scripts/_twistd_unix.py",
line 213, in postApplication
startApplication(self.config, self.application)
File
"/usr/local/lib/python2.5/site-packages/twisted/scripts/_twistd_unix.py",
line 174, in startApplication
service.IService(application).privilegedStartService()
File
"/usr/local/lib/python2.5/site-packages/twisted/application/service.py",
line 228, in privilegedStartService
service.privilegedStartService()
File
"/usr/local/lib/python2.5/site-packages/twisted/application/service.py",
line 228, in privilegedStartService
service.privilegedStartService()
File
"/usr/local/lib/python2.5/site-packages/twisted/application/internet.py",
line 68, in privilegedStartService
self._port = self._getPort()
File
"/usr/local/lib/python2.5/site-packages/twisted/application/internet.py",
line 86, in _getPort
return getattr(reactor, 'listen'+self.method)(*self.args, **self.kwargs)
File "/usr/local/lib/python2.5/site-packages/twisted/internet/posixbase.py",
line 467, in listenTCP
p.startListening()
File "/usr/local/lib/python2.5/site-packages/twisted/internet/tcp.py", line
750, in startListening
self.startReading()
File "/usr/local/lib/python2.5/site-packages/twisted/internet/abstract.py",
line 265, in startReading
self.reactor.addReader(self)
File "/usr/local/lib/python2.5/site-packages/twisted/internet/kqreactor.py",
line 98, in addReader
self._updateRegistration(fd, EVFILT_READ, EV_ADD)
File "/usr/local/lib/python2.5/site-packages/twisted/internet/kqreactor.py",
line 89, in _updateRegistration
kq.kevent([kevent(*args)], 0, 0)
OSError: [Errno 9] Bad file descriptor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20080416/9e1cf76d/attachment.htm 


More information about the Twisted-Python mailing list