Middleware for swift can not get correct response
Bug #1223259 reported by
Che-Wei Hu
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Undecided
|
Mehdi Abaakouk | ||
Grizzly |
Fix Released
|
Medium
|
Eoghan Glynn |
Bug Description
Hi, all:
After adding ceilometer middleware to the swift proxy, I can not get correct response anymore.
For example:
Before adding ceilometer middleware: I can get the correct container list.
After adding ceilometer middleware: I only got empty reply from server.
I am a beginner for studying wsgi and openstack.
Could any one else help to provide suggestions for this issue?
Thanks a lot.
Changed in ceilometer: | |
status: | New → Incomplete |
status: | Incomplete → Confirmed |
assignee: | nobody → Mehdi Abaakouk (sileht) |
Changed in ceilometer: | |
milestone: | none → havana-rc1 |
status: | Fix Committed → Fix Released |
tags: | added: grizzly-backport-potential |
Changed in ceilometer: | |
milestone: | havana-rc1 → 2013.2 |
tags: | removed: grizzly-backport-potential |
To post a comment you must log in.
Hi, all:
I found that I can get correct response from swift proxy if I do the following modification for ceilometer/ objectstore/ swift_middlewar e.py:
class CeilometerMiddl eware(object) :
...
def __call__(self, env, start_response):
...
def iter_response( iterable) : args[0] :
start_ response( *start_ response_ args[0] )
bytes_ sent = 0
if chunk:
bytes_ sent += len(chunk)
yield chunk
finally:
self. publish_ sample( env,
input_ proxy.bytes_ received,
bytes_ sent)
if start_response_
"""
try:
for chunk in iterable:
"""
return iterable
try:
iterable = self.app(env, my_start_response)
self. publish_ sample( env, input_proxy. bytes_received, 0) iterable)
except Exception:
raise
else:
return iter_response(
I have no idea why the python for loop makes the response become empty.
Could any one else help to check this issue?
Thanks a lot!