*** xuhaiwei has joined #senlin | 00:25 | |
*** Qiming has joined #senlin | 01:06 | |
xuhaiwei | morning, Qiming | 01:10 |
---|---|---|
Qiming | morning, sir | 01:12 |
xuhaiwei | you are back to work today? | 01:13 |
xuhaiwei | I want to discuss exception handling a little more | 01:14 |
xuhaiwei | currently when starting a nova instance, some exception like flavor/image not found, which's code number should be 400, but we are raising ResourceNotFound exception like this: https://github.com/stackforge/senlin/blob/master/senlin/profiles/os/nova/server.py#L233 | 01:16 |
Qiming | yes? | 01:17 |
xuhaiwei | ResourceNotFound exception is considered as an senlin internalerror, should be handled further, right | 01:17 |
xuhaiwei | that means a new exception type should be created for this situation | 01:18 |
Qiming | ys | 01:19 |
Qiming | yes | 01:19 |
xuhaiwei | so what should be the new exception? | 01:20 |
openstackgerrit | Merged stackforge/senlin: Treat return value of sdk function call as object https://review.openstack.org/213988 | 01:20 |
Qiming | my guess is that the final exception type to user is up to where the ResourceNotFound exception is caught | 01:20 |
Qiming | there won't be a unified way | 01:21 |
xuhaiwei | in the example link above, I think profiles/os/nova/server.py is already the toppest layer | 01:21 |
Qiming | if all ResourceNotFound exception instances can be converted to exception BlahBlah, we can delete either ResourceNotFound or BlahBlah, because they are duplications | 01:22 |
Qiming | for example, when the ResourceNotFound exception is caught during the execution of a NODE_DELETE action | 01:22 |
Qiming | the proper way to handle might be safely ignore it | 01:23 |
*** lkarm has joined #senlin | 01:24 | |
Qiming | if the exception is caught during the execution of a NODE_UPDATE action, we may want to record an event and mark the action as a failure, saving enough information in the node's status_reason ... etc. | 01:24 |
Qiming | there won't be exceptions to be thrown to users, because the execution is asynchronous | 01:25 |
xuhaiwei | that makes sense to me | 01:25 |
*** lkarm has quit IRC | 01:28 | |
xuhaiwei | but about the case flavor/image not found, what about just raising webob.exc.HTTPNotFound instead of creating new exception | 01:30 |
*** Yanyanhu has joined #senlin | 01:34 | |
*** Qiming has quit IRC | 01:38 | |
*** Qiming has joined #senlin | 01:38 | |
*** mathspanda has joined #senlin | 01:39 | |
*** Yanyanhu has quit IRC | 01:39 | |
*** Yanyan has joined #senlin | 01:40 | |
*** jdandrea has quit IRC | 01:55 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Add functional test for listing policy_types https://review.openstack.org/213626 | 01:57 |
*** elynn has joined #senlin | 02:05 | |
Qiming | xuhaiwei, don't understand what do you mean | 02:18 |
xuhaiwei | i mean dont invite new exception type, just catch the InternalError raised from nova driver, and raise webob.exc.HTTPNotFound(explanation=ex.message) | 02:21 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Add functional test for listing policy_types https://review.openstack.org/213626 | 02:21 |
Qiming | partially agreed | 02:22 |
Qiming | it is always good to eliminate unnecessary exception types | 02:22 |
Qiming | where do you plan to raise webob.exc.HTTPNotFound ? | 02:23 |
Qiming | in which case? | 02:23 |
xuhaiwei | in the case flavor/image not found, raise HTTPNotFound in profile/os/nova/server | 02:23 |
xuhaiwei | After the patch I submitted yesterday( map InternalError to HTTPInternalServerError), in fact, we dont need to raise any webob.exc exceptions unless we don't have the right exception type in senlin | 02:25 |
Qiming | raise HTTPNotFound to whom? | 02:26 |
xuhaiwei | because ResourceNotFound is a child class of InternalError, and InternalError is mapped to HTTPInternalServerError, so if we dont catch ResourceNotFound , HTTPInternalServerError will be raised to use | 02:27 |
xuhaiwei | raise HTTPNotFound to end user | 02:27 |
Qiming | where is the code path to end user? | 02:27 |
xuhaiwei | profile/os/nova/server | 02:27 |
xuhaiwei | it's not the right layer? | 02:28 |
Qiming | it is not about layering | 02:28 |
Qiming | it is about who is catching those exceptions | 02:28 |
xuhaiwei | in fact, no one | 02:29 |
Qiming | user request -> senlin-api -(RPC)--> senlin-engine --> actions || asynchronous || action --> profile --> driver | 02:30 |
Qiming | raising some user-facing exceptions from profile layer can be seen as a quick (exit) path for action executions | 02:31 |
Qiming | but translating the exception types to something user cannot see is a waste, right? | 02:31 |
xuhaiwei | yes | 02:32 |
Qiming | this makes sense to you? | 02:32 |
xuhaiwei | yes | 02:33 |
*** ChrisSen has joined #senlin | 02:33 | |
Qiming | I will vote +1000 for deleting unnecessary exception types | 02:33 |
Qiming | we are not making good use of the "event" module | 02:34 |
Qiming | need to improve that | 02:34 |
xuhaiwei | yes | 02:34 |
xuhaiwei | I am always think about things in a cloud ministrator's way | 02:35 |
xuhaiwei | maybe not uses | 02:36 |
xuhaiwei | to me, for example if I noticed something wrong, I will go to check the service log | 02:36 |
xuhaiwei | since the action is asynchronous, there is no response to the client side when exception happens we can just catch the exception and then sent a event without raising any exception | 02:41 |
Qiming | yes | 02:43 |
Qiming | that's true | 02:43 |
Qiming | event repo would be very important when we switch to async executions | 02:44 |
xuhaiwei | agree | 02:45 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Use correct return value in cluster_action module https://review.openstack.org/214934 | 02:56 |
*** lkarm has joined #senlin | 03:24 | |
*** lkarm has quit IRC | 03:29 | |
openstackgerrit | Merged stackforge/senlin: Use correct return value in cluster_action module https://review.openstack.org/214934 | 03:41 |
*** Qiming has quit IRC | 04:07 | |
*** LiuWei has joined #senlin | 05:13 | |
*** Qiming has joined #senlin | 05:17 | |
*** lkarm has joined #senlin | 05:40 | |
*** lkarm has quit IRC | 05:45 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test https://review.openstack.org/214090 | 05:54 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Use wait_for_delete to wait for nova server deletion https://review.openstack.org/214448 | 05:54 |
Yanyan | hi, Qiming, just saw the test report from Chris, it's really very helpful :) | 06:11 |
Yanyan | will try to work on those bugs he reported | 06:11 |
openstackgerrit | Merged stackforge/senlin: More test cases for registry module https://review.openstack.org/211410 | 06:31 |
xuhaiwei | Yanyan, due to security problem, I can't see that website | 06:42 |
Yanyan | ok, will try to get a copy for you | 06:44 |
xuhaiwei | it's very kind of you | 06:44 |
Yanyan | no problem :) | 06:45 |
Yanyan | so how can I send it to you? through the mail? | 06:46 |
xuhaiwei | it's ok, attach a text file? | 06:47 |
Yanyan | it's a word doc | 06:48 |
Yanyan | will that break the security rule of you company? | 06:48 |
Yanyan | if so, will convert it to txt | 06:49 |
xuhaiwei | it's ok | 06:49 |
Yanyan | just sent it out. Have converted it to a rtf file | 06:52 |
xuhaiwei | got it, thanks | 06:53 |
Yanyan | np | 06:53 |
xuhaiwei | what this message is in your mail '宝宝的进口奶粉纸尿裤,1元全包了' :) | 06:54 |
Yanyan | guess some ad from 网易 :) | 06:54 |
Yanyan | guess this company will embed random ad. in the mail based on the hot search key | 06:55 |
Yanyan | I guess that is because I searched baby paper diaper before... | 06:56 |
Yanyan | oh, BTW, I'm trying to figure out the test failure in this patch, but still can't find the reason https://review.openstack.org/213569 | 06:56 |
xuhaiwei | I have been tortured by this problem for quite a long time | 06:59 |
xuhaiwei | now in my environment, it doesnt happen any more | 06:59 |
Yanyan | it did happen in my local env, but just can't find any clue... | 07:00 |
Yanyan | will keep looking at it | 07:00 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test https://review.openstack.org/214090 | 07:01 |
*** lixinhui has joined #senlin | 07:05 | |
openstackgerrit | Merged stackforge/senlin: Check size limitation in cluster scale in/out action https://review.openstack.org/213964 | 07:13 |
*** ChrisSen has quit IRC | 07:27 | |
*** lkarm has joined #senlin | 07:57 | |
*** lkarm has quit IRC | 08:02 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test https://review.openstack.org/214090 | 08:07 |
*** elynn has quit IRC | 08:22 | |
*** elynn has joined #senlin | 08:26 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Set cluster status to warning after deletion failed https://review.openstack.org/215006 | 08:26 |
*** Qiming has quit IRC | 08:31 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Set cluster status to warning after deletion failed https://review.openstack.org/215006 | 08:32 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test https://review.openstack.org/214090 | 08:40 |
Yanyan | hi, xuhaiwei, I think I might found the reason | 09:08 |
Yanyan | of the test failure in your keystone_v3 patch | 09:08 |
Yanyan | http://git.openstack.org/cgit/stackforge/senlin/tree/senlin/tests/unit/policies/test_lb_policy.py#n20 | 09:08 |
Yanyan | I mocked the incorrect db_api in lb_policy unit test... | 09:09 |
Yanyan | the one from senlin.db should be mocked | 09:09 |
xuhaiwei | why the error doesn't happen in my env? | 09:10 |
Yanyan | although cred_get in senlin.db.api will directly invoke the function with the same name in senlin.db.sqlalchemy.api | 09:10 |
Yanyan | but seems mock will fail occasionally | 09:10 |
Yanyan | e.... | 09:10 |
Yanyan | don't know the reason :( | 09:10 |
xuhaiwei | you mean we should mock db.api not db.sqlalchemy.api? | 09:11 |
Yanyan | after mock correct db api, I tested 10 times using your patch | 09:11 |
Yanyan | all passed | 09:11 |
Yanyan | in this case, yes | 09:11 |
xuhaiwei | ok | 09:11 |
Yanyan | since the function we want to mock is in senlin.db.api | 09:11 |
xuhaiwei | please submit a patch :) | 09:11 |
Yanyan | will propose a patch for this | 09:11 |
xuhaiwei | thanks | 09:11 |
Yanyan | no problem, hope it can resolve this issue :) | 09:12 |
xuhaiwei | yes | 09:13 |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: Mock correct cred_get function in unit test of lb_policy https://review.openstack.org/215031 | 09:16 |
*** mathspanda has quit IRC | 09:21 | |
openstackgerrit | Yanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test https://review.openstack.org/214090 | 09:55 |
openstackgerrit | Merged stackforge/senlin: Mock correct cred_get function in unit test of lb_policy https://review.openstack.org/215031 | 09:59 |
Yanyan | prepare to leave, see U guys tomorrow | 10:00 |
xuhaiwei | see u | 10:00 |
Yanyan | bye :) | 10:00 |
xuhaiwei | bye | 10:02 |
openstackgerrit | xu-haiwei proposed stackforge/senlin: Handle exceptions in keystone_v3 driver https://review.openstack.org/213569 | 10:02 |
*** Yanyan has quit IRC | 10:05 | |
openstackgerrit | xu-haiwei proposed stackforge/senlin: Handle exception in neutron_v2 module https://review.openstack.org/215051 | 10:11 |
*** elynn has quit IRC | 10:32 | |
*** Qiming has joined #senlin | 10:51 | |
*** lkarm has joined #senlin | 12:02 | |
*** Qiming has quit IRC | 13:02 | |
*** lkarm has quit IRC | 13:18 | |
*** Qiming has joined #senlin | 13:35 | |
*** jroyal has joined #senlin | 14:29 | |
*** jroyal has quit IRC | 14:46 | |
*** lkarm has joined #senlin | 14:46 | |
*** jroyal has joined #senlin | 14:47 | |
*** jruano has joined #senlin | 15:01 | |
*** jroyal has quit IRC | 15:17 | |
*** jroyal has joined #senlin | 15:19 | |
*** Qiming has quit IRC | 15:51 | |
*** jroyal has quit IRC | 15:59 | |
*** lkarm has quit IRC | 16:40 | |
*** lkarm has joined #senlin | 18:52 | |
*** lkarm has quit IRC | 18:53 | |
*** lkarm has joined #senlin | 18:53 | |
*** jruano has quit IRC | 19:08 | |
*** jruano has joined #senlin | 19:42 | |
*** jruano has quit IRC | 20:24 | |
*** jruano has joined #senlin | 20:24 | |
*** jruano has quit IRC | 20:51 | |
*** lkarm has quit IRC | 21:51 | |
*** jruano has joined #senlin | 22:20 | |
*** jruano has quit IRC | 22:38 | |
*** jruano has joined #senlin | 22:38 | |
*** xuhaiwei has quit IRC | 23:35 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!