[openstack-dev] [ceilometer] raise clientSideError or do for user

ZhiQiang Fan aji.zqfan at gmail.com
Mon Apr 14 12:24:06 UTC 2014


Hi, developers,

For fixing bug https://launchpad.net/bugs/1304886, I uploaded a patch
https://review.openstack.org/#/c/86501/, when review this patch, there are
two different kinds of opinions, I don't know which is the better choice,
so I ask for help here.

The patch aims at disallow user specify duplicate alarm ids in combination
rule to reduce unnecessary alarm evaluate. We can avoid such input in two
ways:

* reject user's request with 400, so force user to provide unique list
* accept such request but remove duplicate ids for the user

the problem is that
* the server side actually has no error, it just considers the efficiency
problem (and the efficiency improvement is tiny), so reject the request
seems a bit rude
* the user provide a bad request but we accept, which will cause the user
think he is doing a right thing, although he can check the return result
and find something different, but from my experience, I usually only check
response status code, and will not check each attribute carefully.

here is an existent example of accept such problematical request which
provided by Ildiko Vancsa:
https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L904
or search 'def statistic' in that file if LOC is changed

can you provide your opinion, or directly review that patch please?

thanks
<https://github.com/openstack/ceilometer/blob/master/ceilometer/api/controllers/v2.py#L904>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140414/72dd45b5/attachment.html>


More information about the OpenStack-dev mailing list