Unhandled exception on 504 error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python client library for Zaqar |
Fix Released
|
Medium
|
Shaifali Agrawal |
Bug Description
A load balancer/proxy such as HAProxy may return 504 and an HTML body. In that case, the client raises a ValueError in transport/
Traceback (most recent call last):
File "/usr/local/
result = self._run(
File "/root/
queue.
File "/usr/local/
self._name, messages)
File "/usr/local/
return resp.deserializ
File "/usr/local/
self.
File "/usr/lib/
return _default_
File "/usr/lib/
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
description: | updated |
Changed in python-zaqarclient: | |
assignee: | nobody → Shaifali Agrawal (agrawalshaifali09) |
Changed in python-zaqarclient: | |
milestone: | none → 0.2.0 |
status: | Fix Committed → Fix Released |
Can the LB be configured to return something else instead of the HTML? Why should zaqarclient care about this?
I may be wrong here but I think it's completely fair to just assume the response is of the expected type. We could add a check on the content-type but then we also need to answer the question of what the client should do if the content-type is not supported. Should it raise an exception? Should the 504 be communicated back to the user?