fapws3 doesn't work with multiprocessing module

24 views
Skip to first unread message

Wu Zhe

unread,
May 27, 2009, 11:24:33 AM5/27/09
to Fast Asynchronous Python Web Server
I have got a problem to make fapws3 work with multiprocessing module,
more detail at

http://stackoverflow.com/questions/914821/producer-consumer-problem-with-python-multiprocessing

william opensource4you

unread,
May 28, 2009, 3:12:20 AM5/28/09
to fa...@googlegroups.com
Hello Wu Zhe,

with the current implementation fo Fapws3, the only way to stop it it
to kill it.

But, in fact, I don't understand quite well what will be the
conditions to kill it.

After completion of one http request ? this sounds strange because
fapws has been build to run forever
After some time ? how much time them ? based on which criteria ?
Every Fapws server use a port, How will you manager the open ports,
the one no more used ? How your frontend (proxy, ....) will know to
which ports it must talk ?

Sorry, I'm not fully understand your point.

William

Wu Zhe

unread,
May 28, 2009, 5:27:45 AM5/28/09
to Fast Asynchronous Python Web Server


On May 28, 3:12 pm, william opensource4you <william.o...@gmail.com>
wrote:
> Hello Wu Zhe,
>
> with the current implementation fo Fapws3, the only way to stop it it
> to kill it.
>
> But, in fact, I don't understand quite well what will be the
> conditions to kill it.
>
> After completion of one http request ? this sounds strange because
> fapws has been build to run forever
> After some time ? how much time them ? based on which criteria ?
> Every Fapws server use a port, How will you manager the open ports,
> the one no more used ? How your frontend (proxy, ....) will know to
> which ports it must talk ?
>
> Sorry, I'm not fully understand your point.
>
> William

Every server needs some way to be stopped gracefully anyway, killing
the process is one way, but the server should have some signal
(SIGTERM/SIGHUP) handlers which do some cleaning up: close the opened
ports/files. I think it's always better to do it in the server rather
than relying on OS to do it.

I would be grateful if you read the question in stackoverflow.com
mentioned in my previous post, I explained there the most serious
problem is fapws3 doesn't work with multiprocessing package.

william opensource4you

unread,
May 28, 2009, 2:01:54 PM5/28/09
to fa...@googlegroups.com
Sure I've read your posts.

But as I've said, I don't understand your point.
Fapws is a server.

I've implemented a SIGINT, and when it's detected, the ports a cleanly closed.

Wu Zhe

unread,
May 29, 2009, 12:49:45 AM5/29/09
to Fast Asynchronous Python Web Server


On May 29, 2:01 am, william opensource4you <william.o...@gmail.com>
wrote:
> Sure I've read your posts.
>
> But as I've said, I don't understand your point.
> Fapws is a server.
>
> I've implemented a SIGINT, and when it's detected, the ports a cleanly closed.
>

The problem is simple. In the fapws3 request handler I use queue.put()
to put an item into the queue whenever a new request is received, but
other processes can only queue.get() the first item in the queue,
after that they are blocked forever when there *are* items
subsequently put by the handler.

However paste.httpserver (http://pythonpaste.org) doesn't have the
above problem.

Lateef Jackson

unread,
Jun 2, 2009, 7:46:32 AM6/2/09
to fa...@googlegroups.com

On May 29, 2009 12:49 AM, "Wu Zhe" <jess...@gmail.com> wrote:




On May 29, 2:01 am, william opensource4you <william.o...@gmail.com>
wrote:

> Sure I've read your posts. > > But as I've said, I don't understand your point. > Fapws is a serve...

Reply all
Reply to author
Forward
0 new messages