Issue #1253 new

Exception when using the profiler

created an issue

I am running cherrypy 3.2.2 with python 2.6.6 (x86) under Windows 7 (x64).

I am trying to enable profiling globally for my app, using the profiling support in cherrypy.lib.profiler. However, after a few requests, the server stops responding and I start seeing the following in the console:

AssertionError: ('Bad call', ('', 0, 'setprofile'), <frame object at 0x02D25050>
, <frame object at 0x02D30FF8>, <frame object at 0x04FC2C18>, <frame object at 0

I am using the following lines to enable profiling:

server_cpapp = cherrypy.Application(HelloWorld(), "/")
server_profile_cpapp = cherrypy.lib.profiler.make_app(server_cpapp, 'c:/temp', True)        

This may not be the correct way of enabling profiling globally, however I could not find any clear documentation of how to do so.

Attached is a minimal example able to reproduce the issue. It will take a few hundred requests before the bug kicks in, holding down F5 in firefox usually triggers it within a few seconds.

This bug might be related to Issue 74481 in python, which is reported as closed but still reproducible in python 2.6.6 and 2.7.

Comments (1)

  1. wiesener reporter

    I believe this is a concurrency issue, as setting

    cherrypy.config.update({'server.thread_pool': 1})

    seems to resolve the issue for the isolated test. This is obviously not an acceptable solution for the actual app.

  2. Log in to comment