Re: [Repoze-dev] repoze.bfg.xmlrpc - httpserver hangs

2009-09-09 Thread simahawk
On Wed, 2009-09-09 at 11:44 -0400, Chris McDonough wrote:
> simahawk wrote:
> > hi list,
> > 
> > I created a web-service with repoze.bfg and repoze.bfg.xmlrpc with a
> > xmlrpx_view. This views creates a PDF and it should return me a simple
> > string with the url of the PDF but in order to get my string back I need
> > to restart repoze 'cause the application hangs at some point after the
> > view returns the string.
> > 
> > I went trough the code with pdb and I found that the application hangs
> > on the method "worker_thread_callback" in
> > Paste-1.7.2-py2.6.egg/paste/httpserver.py
> > 
> > I tried to make the view returning the string directly and it works...
> > so it seems it doesn't like processing stuff in the meanwhile... :)
> > 
> > In other word, this works:
> > 
> > [...]
> > @xmlrpc_view
> > def generate_report(context, data):
> > url = 'http://foo.com/static/file.pdf'
> > return url
> > [...]
> > 
> > whilst this don't:
> > 
> > [...]
> > @xmlrpc_view
> > def generate_report(context, data):
> > do_this
> > [...]
> > do_that
> > url = 'http://foo.com/static/file.pdf'
> > return url
> > [...]
> > 
> > It's a bit weird... any suggestion will be much appreciated.
> 
> You might try the "threads" middleware of repoze.debug:
> 
> http://pypi.python.org/pypi/repoze.debug/0.7
> 
> It might help you get an idea of what your threads are doing during the 
> "lockup".
> 
> - C

Thanks Chris, I'll give a try.

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


Re: [Repoze-dev] repoze.bfg.xmlrpc - httpserver hangs

2009-09-09 Thread Chris McDonough
simahawk wrote:
> hi list,
> 
> I created a web-service with repoze.bfg and repoze.bfg.xmlrpc with a
> xmlrpx_view. This views creates a PDF and it should return me a simple
> string with the url of the PDF but in order to get my string back I need
> to restart repoze 'cause the application hangs at some point after the
> view returns the string.
> 
> I went trough the code with pdb and I found that the application hangs
> on the method "worker_thread_callback" in
> Paste-1.7.2-py2.6.egg/paste/httpserver.py
> 
> I tried to make the view returning the string directly and it works...
> so it seems it doesn't like processing stuff in the meanwhile... :)
> 
> In other word, this works:
> 
> [...]
> @xmlrpc_view
> def generate_report(context, data):
> url = 'http://foo.com/static/file.pdf'
> return url
> [...]
> 
> whilst this don't:
> 
> [...]
> @xmlrpc_view
> def generate_report(context, data):
> do_this
> [...]
> do_that
> url = 'http://foo.com/static/file.pdf'
> return url
> [...]
> 
> It's a bit weird... any suggestion will be much appreciated.

You might try the "threads" middleware of repoze.debug:

http://pypi.python.org/pypi/repoze.debug/0.7

It might help you get an idea of what your threads are doing during the 
"lockup".

- C


> 
> Thanks,
> SimO
> 
> ___
> Repoze-dev mailing list
> Repoze-dev@lists.repoze.org
> http://lists.repoze.org/listinfo/repoze-dev
> 

___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev