Thursday, 2015-08-20

*** xuhaiwei has joined #senlin00:25
*** Qiming has joined #senlin01:06
xuhaiweimorning, Qiming01:10
Qimingmorning, sir01:12
xuhaiweiyou are back to work today?01:13
xuhaiweiI want to discuss exception handling a little more01:14
xuhaiweicurrently 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#L23301:16
Qimingyes?01:17
xuhaiweiResourceNotFound exception is considered as an senlin internalerror, should be handled further, right01:17
xuhaiweithat means a new exception type should be created for this situation01:18
Qimingys01:19
Qimingyes01:19
xuhaiweiso what should be the new exception?01:20
openstackgerritMerged stackforge/senlin: Treat return value of sdk function call as object  https://review.openstack.org/21398801:20
Qimingmy guess is that the final exception type to user is up to where the ResourceNotFound exception is caught01:20
Qimingthere won't be a unified way01:21
xuhaiweiin the example link above, I think profiles/os/nova/server.py is already the toppest layer01:21
Qimingif all ResourceNotFound exception instances can be converted to exception BlahBlah, we can delete either ResourceNotFound or BlahBlah, because they are duplications01:22
Qimingfor example, when the ResourceNotFound exception is caught during the execution of a NODE_DELETE action01:22
Qimingthe proper way to handle might be safely ignore it01:23
*** lkarm has joined #senlin01:24
Qimingif 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
Qimingthere won't be exceptions to be thrown to users, because the execution is asynchronous01:25
xuhaiweithat makes sense to me01:25
*** lkarm has quit IRC01:28
xuhaiweibut about the case flavor/image not found, what about just raising webob.exc.HTTPNotFound instead of creating new exception01:30
*** Yanyanhu has joined #senlin01:34
*** Qiming has quit IRC01:38
*** Qiming has joined #senlin01:38
*** mathspanda has joined #senlin01:39
*** Yanyanhu has quit IRC01:39
*** Yanyan has joined #senlin01:40
*** jdandrea has quit IRC01:55
openstackgerritYanyan Hu proposed stackforge/senlin: Add functional test for listing policy_types  https://review.openstack.org/21362601:57
*** elynn has joined #senlin02:05
Qimingxuhaiwei, don't understand what do you mean02:18
xuhaiweii mean dont invite new exception type, just catch the InternalError raised from nova driver, and raise webob.exc.HTTPNotFound(explanation=ex.message)02:21
openstackgerritYanyan Hu proposed stackforge/senlin: Add functional test for listing policy_types  https://review.openstack.org/21362602:21
Qimingpartially agreed02:22
Qimingit is always good to eliminate unnecessary exception types02:22
Qimingwhere do you plan to raise webob.exc.HTTPNotFound ?02:23
Qimingin which case?02:23
xuhaiweiin the case flavor/image not found, raise HTTPNotFound in profile/os/nova/server02:23
xuhaiweiAfter 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 senlin02:25
Qimingraise HTTPNotFound to whom?02:26
xuhaiweibecause ResourceNotFound is a child class of InternalError, and InternalError is mapped to HTTPInternalServerError, so if we dont catch ResourceNotFound , HTTPInternalServerError will be raised to use02:27
xuhaiweiraise HTTPNotFound to end user02:27
Qimingwhere is the code path to end user?02:27
xuhaiweiprofile/os/nova/server02:27
xuhaiweiit's not the right layer?02:28
Qimingit is not about layering02:28
Qimingit is about who is catching those exceptions02:28
xuhaiweiin fact, no one02:29
Qiminguser request -> senlin-api -(RPC)--> senlin-engine --> actions || asynchronous || action --> profile --> driver02:30
Qimingraising some user-facing exceptions from profile layer can be seen as a quick (exit) path for action executions02:31
Qimingbut translating the exception types to something user cannot see is a waste, right?02:31
xuhaiweiyes02:32
Qimingthis makes sense to you?02:32
xuhaiweiyes02:33
*** ChrisSen has joined #senlin02:33
QimingI will vote +1000 for deleting unnecessary exception types02:33
Qimingwe are not making good use of the "event" module02:34
Qimingneed to improve that02:34
xuhaiweiyes02:34
xuhaiweiI am always think about things in a cloud ministrator's way02:35
xuhaiweimaybe not uses02:36
xuhaiweito me, for example if I noticed something wrong, I will go to check the service log02:36
xuhaiweisince 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 exception02:41
Qimingyes02:43
Qimingthat's true02:43
Qimingevent repo would be very important when we switch to async executions02:44
xuhaiweiagree02:45
openstackgerritYanyan Hu proposed stackforge/senlin: Use correct return value in cluster_action module  https://review.openstack.org/21493402:56
*** lkarm has joined #senlin03:24
*** lkarm has quit IRC03:29
openstackgerritMerged stackforge/senlin: Use correct return value in cluster_action module  https://review.openstack.org/21493403:41
*** Qiming has quit IRC04:07
*** LiuWei has joined #senlin05:13
*** Qiming has joined #senlin05:17
*** lkarm has joined #senlin05:40
*** lkarm has quit IRC05:45
openstackgerritYanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test  https://review.openstack.org/21409005:54
openstackgerritYanyan Hu proposed stackforge/senlin: Use wait_for_delete to wait for nova server deletion  https://review.openstack.org/21444805:54
Yanyanhi, Qiming, just saw the test report from Chris, it's really very helpful :)06:11
Yanyanwill try to work on those bugs he reported06:11
openstackgerritMerged stackforge/senlin: More test cases for registry module  https://review.openstack.org/21141006:31
xuhaiweiYanyan, due to security problem, I can't see that website06:42
Yanyanok, will try to get a copy for you06:44
xuhaiweiit's very kind of you06:44
Yanyanno problem :)06:45
Yanyanso how can I send it to you? through the mail?06:46
xuhaiweiit's ok, attach a text file?06:47
Yanyanit's a word doc06:48
Yanyanwill that break the security rule of you company?06:48
Yanyanif so, will convert it to txt06:49
xuhaiweiit's ok06:49
Yanyanjust sent it out. Have converted it to a rtf file06:52
xuhaiweigot it, thanks06:53
Yanyannp06:53
xuhaiweiwhat this message is in your mail '宝宝的进口奶粉纸尿裤,1元全包了'  :)06:54
Yanyanguess some ad from 网易 :)06:54
Yanyanguess this company will embed random ad. in the mail based on the hot search key06:55
YanyanI guess that is because I searched baby paper diaper before...06:56
Yanyanoh, BTW, I'm trying to figure out the test failure in this patch, but still can't find the reason https://review.openstack.org/21356906:56
xuhaiweiI have been tortured by this problem for quite a long time06:59
xuhaiweinow in my environment, it doesnt happen any more06:59
Yanyanit did happen in my local env, but just can't find any clue...07:00
Yanyanwill keep looking at it07:00
openstackgerritYanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test  https://review.openstack.org/21409007:01
*** lixinhui has joined #senlin07:05
openstackgerritMerged stackforge/senlin: Check size limitation in cluster scale in/out action  https://review.openstack.org/21396407:13
*** ChrisSen has quit IRC07:27
*** lkarm has joined #senlin07:57
*** lkarm has quit IRC08:02
openstackgerritYanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test  https://review.openstack.org/21409008:07
*** elynn has quit IRC08:22
*** elynn has joined #senlin08:26
openstackgerritYanyan Hu proposed stackforge/senlin: Set cluster status to warning after deletion failed  https://review.openstack.org/21500608:26
*** Qiming has quit IRC08:31
openstackgerritYanyan Hu proposed stackforge/senlin: Set cluster status to warning after deletion failed  https://review.openstack.org/21500608:32
openstackgerritYanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test  https://review.openstack.org/21409008:40
Yanyanhi, xuhaiwei, I think I might found the reason09:08
Yanyanof the test failure in your keystone_v3 patch09:08
Yanyanhttp://git.openstack.org/cgit/stackforge/senlin/tree/senlin/tests/unit/policies/test_lb_policy.py#n2009:08
YanyanI mocked the incorrect db_api in lb_policy unit test...09:09
Yanyanthe one from senlin.db should be mocked09:09
xuhaiweiwhy the error doesn't happen in my env?09:10
Yanyanalthough cred_get in senlin.db.api will directly invoke the function with the same name in senlin.db.sqlalchemy.api09:10
Yanyanbut seems mock will fail occasionally09:10
Yanyane....09:10
Yanyandon't know the reason :(09:10
xuhaiweiyou mean we should mock db.api not db.sqlalchemy.api?09:11
Yanyanafter mock correct db api, I tested 10 times using your patch09:11
Yanyanall passed09:11
Yanyanin this case, yes09:11
xuhaiweiok09:11
Yanyansince the function we want to mock is in senlin.db.api09:11
xuhaiweiplease submit a patch :)09:11
Yanyanwill propose a patch for this09:11
xuhaiweithanks09:11
Yanyanno problem, hope it can resolve this issue :)09:12
xuhaiweiyes09:13
openstackgerritYanyan Hu proposed stackforge/senlin: Mock correct cred_get function in unit test of lb_policy  https://review.openstack.org/21503109:16
*** mathspanda has quit IRC09:21
openstackgerritYanyan Hu proposed stackforge/senlin: [WIP]Add fake nova_v2 driver for functional test  https://review.openstack.org/21409009:55
openstackgerritMerged stackforge/senlin: Mock correct cred_get function in unit test of lb_policy  https://review.openstack.org/21503109:59
Yanyanprepare to leave, see U guys tomorrow10:00
xuhaiweisee u10:00
Yanyanbye :)10:00
xuhaiweibye10:02
openstackgerritxu-haiwei proposed stackforge/senlin: Handle exceptions in keystone_v3 driver  https://review.openstack.org/21356910:02
*** Yanyan has quit IRC10:05
openstackgerritxu-haiwei proposed stackforge/senlin: Handle exception in neutron_v2 module  https://review.openstack.org/21505110:11
*** elynn has quit IRC10:32
*** Qiming has joined #senlin10:51
*** lkarm has joined #senlin12:02
*** Qiming has quit IRC13:02
*** lkarm has quit IRC13:18
*** Qiming has joined #senlin13:35
*** jroyal has joined #senlin14:29
*** jroyal has quit IRC14:46
*** lkarm has joined #senlin14:46
*** jroyal has joined #senlin14:47
*** jruano has joined #senlin15:01
*** jroyal has quit IRC15:17
*** jroyal has joined #senlin15:19
*** Qiming has quit IRC15:51
*** jroyal has quit IRC15:59
*** lkarm has quit IRC16:40
*** lkarm has joined #senlin18:52
*** lkarm has quit IRC18:53
*** lkarm has joined #senlin18:53
*** jruano has quit IRC19:08
*** jruano has joined #senlin19:42
*** jruano has quit IRC20:24
*** jruano has joined #senlin20:24
*** jruano has quit IRC20:51
*** lkarm has quit IRC21:51
*** jruano has joined #senlin22:20
*** jruano has quit IRC22:38
*** jruano has joined #senlin22:38
*** xuhaiwei has quit IRC23:35

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!