Exa-Networks / exaproxy

Performant Content Modifying Non-Caching Proxy [stable - accepting patches for bug fixes only]
Other
145 stars 36 forks source link

Don't crash if getStats returns None #28

Closed ema closed 10 years ago

ema commented 10 years ago

Hi!

This patch fixes the following error:

Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/opt/exaproxy/lib/exaproxy/util/debug.py", line 71, in execfile(sys.argv[0]) File "/opt/exaproxy/lib/exaproxy/application.py", line 317, in main() File "/opt/exaproxy/lib/exaproxy/application.py", line 280, in main Supervisor(configuration).run() File "/opt/exaproxy/lib/exaproxy/supervisor.py", line 300, in run self.monitor.second() File "/opt/exaproxy/lib/exaproxy/monitor.py", line 146, in second self.seconds.append(self.statistics()) File "/opt/exaproxy/lib/exaproxy/monitor.py", line 122, in statistics [redirector_stats] = redirector.getStats() TypeError: 'NoneType' object is not iterable

thomas-mangin commented 10 years ago

AFAIK, the code should never return None .. I will ask David to have a look ...

ema commented 10 years ago

Thanks Thomas!

thomas-mangin commented 10 years ago

As I thought, we can not take the patch as is - because None means that we have lost a local pipe so something went wrong up along the chain and need sorting up. All being fine, David will have the fix for you within the next hour because I like it when a plan comes together ..

thomas-mangin commented 10 years ago

fixed in pull #29

ema commented 10 years ago

Very cool! Thank you guys.

thomas-mangin commented 10 years ago

We appreciate the feedback. Hopefully, you will not find any more issues ... "yeah, right" :-)