[openstack-dev] [Swift] question on Application class concurrency; paste.app_factory mechanism
Luse, Paul E
paul.e.luse at intel.com
Wed Jul 24 02:31:45 UTC 2013
Trying to understand a bit more about the Application class defined in proxy/server.py. Looks like it instantiated by means of paste deploy application factories which I know really nothing about. Using the saio environment it looks like a class is instantiated when the service is started for the first time and when I perform the first operation against the service but not subsequent operations. I was thinking that each connection would get its own instance thus it would be sage to store connection-transient information there but I was surprised by my quick test.
Basically, here's all I did:
a) Add an element to the application class and init it to 0
b) Add a log statement to the _init_ method of Application
c) In the _call_ method of Application I increment the test element and print it
And what I see is (1) the log statement in _init_ runs when the service starts and when I do the very first GET (via curl cmd line) and (2) subsequent GET calls don't show the _init_ log statement and show the variable incrementing with every call.
Any insight would be appreciated...
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the OpenStack-dev