Wednesday, 2015-07-22

*** jruano has quit IRC00:08
*** xuhaiwei has joined #senlin00:33
*** xuhaiwei has quit IRC00:54
*** xuhaiwei has joined #senlin00:55
*** Qiming has joined #senlin00:57
*** jruano has joined #senlin01:03
openstackgerritMerged stackforge/senlin: Updated from global requirements
*** jruano has quit IRC01:09
*** jdandrea has quit IRC01:11
openstackgerritxu-haiwei proposed stackforge/senlin: Add node module test case part1
*** jruano has joined #senlin01:28
*** Yanyanhu has joined #senlin01:32
*** jruano has quit IRC01:41
openstackgerritxu-haiwei proposed stackforge/python-senlinclient: Parse exception from SDK
openstackgerritMerged stackforge/python-senlinclient: Parse exception from SDK
*** jruano has joined #senlin02:00
*** Zhenqi has joined #senlin02:05
*** jruano has quit IRC02:13
openstackgerritYanyan Hu proposed stackforge/senlin: Add test case for policy base module and fix a bug
*** Zhenqi has quit IRC02:16
*** Zhenqi has joined #senlin02:16
*** jruano has joined #senlin02:17
*** jruano has quit IRC02:17
*** Zhenqi has quit IRC02:20
*** Qiming_ has joined #senlin02:26
*** Qiming has quit IRC02:30
*** Tennyson has joined #senlin03:15
*** Qiming_ is now known as Qiming03:18
Qimingseems the environment revision is working?03:18
Yanyanhuyes :)03:22
QimingI'm not feeling comfortable about the object initializations03:31
Qimingsometimes we use None, sometimes we use ''03:31
Qimingwe need a convention on this03:31
Yanyanhuhmm, that's a problem03:32
Qimingwe don't know if a field/property is not assigned or it has default to '' or set explicitly to ''03:32
Qiminglet's think about this03:33
Qimingcould be a topic for test cases03:33
Qiminglunch go03:33
*** jruano has joined #senlin03:46
*** jruano has quit IRC04:31
*** hightall has joined #senlin04:47
openstackgerritMerged stackforge/senlin: Add node module test case part1
openstackgerritOpenStack Proposal Bot proposed stackforge/senlin: Updated from global requirements
*** Zhenqi has joined #senlin05:23
openstackgerritMerged stackforge/senlin: Add test case for policy base module and fix a bug
*** mathspanda has joined #senlin05:27
Yanyanhuhi, Qiming, I'm trying to work on test case of nova_v2 driver. But before that, I think maybe we should refactor the exception handling in this driver first, something like what you have done for neutron_v2 driver in this patch
Qimingthat's something worth doing I think05:41
Qimingwriting test case is a good chance to revisit the code05:43
Yanyanhuright :)05:44
openstackgerritQiming Teng proposed stackforge/senlin: Remove some unused dependencies
xuhaiweiYanyanhu, will you do the exception handling for nova_v2?05:57
YanyanhuI can, but if you have had a plan for this, I will work on test case of lb_policy first :)05:58
xuhaiweiNot a specific plan up to now :(05:59
Yanyanhuno problem, I will try to propose a patch for this05:59
Yanyanhuwelcome :)06:00
openstackgerritYanyan Hu proposed stackforge/senlin: Add a new exception type 'ResourceUpdatingFailure'
openstackgerritYanyan Hu proposed stackforge/senlin: Add a new exception type 'ResourceUpdateFailure'
*** mathspanda has quit IRC06:29
*** lixinhui_ has joined #senlin06:35
*** mathspanda has joined #senlin06:54
openstackgerritYanyan Hu proposed stackforge/senlin: Refactor the exception handling in nova_v2 driver
lixinhui_I compared the senlin node-create and nova boot, debug only shows limited information about connection between sdk and nova server07:10
lixinhui_please help me on this07:10
lixinhui_but nova boot shows complete communication and message body07:11
* Qiming is in heat meeting07:12
Yanyanhuhi, lixinhui_ , I think you may not be able to get detail debug information about interaction between sdk and nova when you create senlin node using a nova server profile07:19
Yanyanhuso you want to get the detail information about how sdk talks with nova when senlin node is created?07:21
xuhaiweiQiming, busy with heat meeting?07:41
*** Zhenqi has quit IRC07:50
*** Zhenqi has joined #senlin07:51
xuhaiweiQiming, I found the reason why all the update methods doesn't work08:03
Qimingupdate is not implemented08:03
xuhaiweithat is because openstacksdk client is using PUT method to request, but senlin api is using PATCH08:03
Qimingsdk can choose between patch and put?08:04
xuhaiweinode-update is implemented at least i think08:04
xuhaiweiI am afraid not08:04
Qimingit is there08:05
xuhaiweithis is what they do08:05
Qimingthis is create code08:06
Qiminga resource can set patch_update to true08:06
xuhaiweiyes, line 74708:06
xuhaiweiohh, so we can change it to true in senlinclient?08:07
Qimingsome resources are using PATCH as well08:07
Qimingyes we should08:08
*** Tennyson has quit IRC08:12
*** Zhenqi has quit IRC08:14
*** Zhenqi has joined #senlin08:14
openstackgerritxu-haiwei proposed stackforge/python-senlinclient: Use PATCH method to update resources
openstackgerritxu-haiwei proposed stackforge/python-senlinclient: Use PATCH method to update resources
Qiminghi, xuhaiwei and Yanyanhu08:44
Qimingdo you have a few mins to talk about the exception handling in drivers?08:44
Yanyanhusure, just want to talk with you about this.08:45
Yanyanhumy firefox is closed for java7 update...08:45
xuhaiweiI am ok08:45
Yanyanhuso may not be able to open the review page08:45
Qimingso I saw your discussions on the review page08:46
Qimingit's interesting08:46
xuhaiweibut the problem is not easy to resolve imo08:46
Qimingbasically, I think Yanyan was duplicating what we have done to another driver08:46
Qimingand the intent was to kill all exceptions internally, avoid sending any information that makes no sense to users08:47
Qimingthe current approach might lead to a situation of over kill08:48
Qimingxuhaiwei has some valid concerns that there are cases we need to let users know what happened, it could be just their errors08:48
Qimingit's a trade-off, tough one08:48
Qimingwhen I was working on a similar driver (cannot recall which one), I was thinking to myself08:49
Qiminghow many different error types we will need to deal with?08:50
Qimingno answer08:50
xuhaiweiimo, the exception's name is not important, the important thing is the error code08:50
Yanyanhuyes, actually it's difficult since we can't ensure whether we can get enough information from SDK to help us decide how to classify and handle the exception raised from driver08:50
Qimingso the current approach is to dump the excetions at driver code, and we can move on to do a better job in future08:50
Qimingideally, we can have a utility function that will do all exception translation08:52
xuhaiweilike what was done in the client side?08:52
Qimingto other services senlin-engine is talking to, senlin-engine is the client08:53
QimingI am referring that as an "ideal" case because ... there will be special cases08:54
Qimingwe just don't know yet08:54
Yanyanhuso Qiming, I think maybe we should include the ex msg into the exception as haiwei sugguested and reserver it for possible usage in future?08:55
xuhaiweihonestly, when I thought about the exception handling problem in senlin for the first time, the most thing I was worring about is we will import 500 error, if we can't handle exceptions like 400 and 40408:55
Qimingso, how about we copy the client side exception handling code to the server side08:55
Yanyanhuem, this can cover some cases08:56
Qimingwe develop the exception handling in a common module and see if we can catch them all08:56
Yanyanhubut just as you said, there are other special cases08:56
Qimingwe just don't know08:56
xuhaiweithat may make things too complicated I am afraid08:57
Qimingif we cannot parse the exception, we check its error code, create a message for users to know, dump the exception in engine for developers to analyze08:57
Qimingthere are just too many locations in the drivers subdirectory where we need to handle exceptions08:58
xuhaiweithat's not bad08:58
Qimingdo the best we can08:58
xuhaiweiwe judge the error message, if it is meaningful to users, we just don't change it08:59
Yanyanhuyou mean status code based judgement?08:59
xuhaiweiyes, status code and error message09:00
Qimingfor example, we are manipulating trusts inside the api, the middleware and the engine09:00
Yanyanhuok, since I'm a little worried that message text based judgement could be too complicated09:00
Qimingwe are not supposed to expose those messages to users09:00
Qimingwe can start with a 'translate_exception()' function09:01
Qimingif needed later on, we can provide a 'translate_resource_creation_exception_types()' function09:02
Qimingmaybe we will never go that far09:02
xuhaiweiso about Yanyanhu's patch, how to handle it? just let the HttpException go up?09:05
Yanyanhuok, so basically, all exception happened in driver will be translated first. After this translation, some of them will be just logged, and some of them will be converted to internal exception which means http500, and others will be converted to a meaningful exception that sent back to end user09:05
xuhaiweithe first step is a little vague09:06
xuhaiweihow to translate it?09:06
Qimingto make the code more robust, maybe we can do this?09:07
Yanyanhuxuhaiwei, may need some text parsing I guess. but still not very clear about it09:08
Qimingcopy the client side exception parsing to server repo09:08
Yanyanhuworth to have a try09:08
Qimingtext based parsing doesn't sound practical09:08
Yanyanhubut just as xuhaiwei said, could be too complicated09:08
YanyanhuQiming, since I guess what we can get from sdk is just exception msg...09:09
xuhaiweicopy the client side exception parsing especially for the driver exception handling?09:09
Yanyanhuwhich could include status code and message info09:09
xuhaiweiwe can make a test for nova_v2 using the client exception parsing09:10
QimingYanyanhu, check this:
Qimingit is about exception code, record format and message09:11
QimingI'm not sure if this line is good enough:09:15
Qiming except sdk.exc.HttpException as ex:09:15
xuhaiweiin this case, we dont need to translate HttpException in the drivers i think09:15
Yanyanhu404 from keystone and 404 from nova could have different meaning for enduser...09:15
xuhaiweiwe still have error message though09:16
Yanyanhuif we want to translate them correctly, we also need to know the context that the exception happened, e.g. in trust middleware? or in nova.server profile09:17
Qimingit looks like we only handle the HttpException fro SDK09:17
xuhaiweiQiming, in openstacksdk the biggest exception is SDKException09:18
xuhaiweimaybe we should catch it first09:18
Yanyanhusdk doesn't provide enought support for exception I think09:19
Yanyanhuin current stage09:19
Qimingyes, so code at this layer should do 'except Exception as ex':09:19
Yanyanhubased on the code of openstack/exception.py09:19
xuhaiweiSDKException has 9 child exception types09:19
QimingThen we parse the exception type, in hope it is just a HttpException09:20
QimingAnyway, we "parse" or "translate" the exception at the driver layer09:20
Qimingmake them look the same way (the senlin way), then we report certain exception type (subclass of InternalError)09:21
Qimingthe invoker to the driver code will determine whether it worth expose it to the user09:22
Yanyanhuok, make sense to me09:22
Yanyanhusince we don't have enough support from sdk, maybe the only we to ensure correctness of exception converting is let high level code do it case by case09:23
QimingWhen forming the InternalError, we can always provide error code and message09:23
Qimingbecause we already did a format translation at the lowest layer09:23
Qimingagain, we are always doing our best, :)09:23
xuhaiweithings get clear I think09:24
Qimingokay, suppose we have a utility function for exception handling09:25
Qimingwe can unify the driver exception handling to something like this:09:25
Qiming try:09:26
Qiming    self.conn.do_something()09:26
Qiming  except Exception as ex:09:26
Qiming    raise exutil.parse(ex)09:26
Yanyanhulooks nice09:27
Qimingthen all these ResourceNotFound, ... exception types will go away09:27
xuhaiweimaybe need them in the upper layer?09:28
Yanyanhuyes, the same question09:28
Qiminglet's use an example here:09:28
Qimingsay we do a flavor_get09:28
Qimingthere could be a 404, which is so .... normal09:29
Qimingflavor_get is invoked from nova.server profile, before creating/booting a nova server09:29
*** hightall has quit IRC09:30
Qimingserver creation is part of a node_create action09:30
*** mathspanda has quit IRC09:31
Qimingthe error code is not helpful in this case09:31
xuhaiweiin exutil.parse() we should figure out NotFoundException which is raised by SDK in this case, and then translate it to something senlin style exception in upper layer09:31
Qimingthe only useful message is the 'message' from the InternalError (filled in by the exutil.parse() func above)09:32
*** Zhenqi has quit IRC09:32
Qimingwe will kill such all exceptions related to flavor_get in the nova server profile09:33
Qimingsave the 'message' as status_reason, mark status as FAILED and exit09:33
Qimingthere is no user facing exceptions here09:33
YanyanhuQiming, understand what you mean about the logic. The problem is what is the output of exutils.parse(ex)09:34
xuhaiweiI think it should be an exception type09:35
Yanyanhuthe input is the Exception from sdk(in most cases if we don't have other unexpected exception duing the code execution)09:35
Qimingan InternalError?09:35
Yanyanhuonly one exception type?09:35
Yanyanhuor ResourceNotFound, ResourceCreationFailure kind of things?09:35
xuhaiweiyes, a senlin internalerror with error code and message09:36
Yanyanhuif the first one, it means exutil.parse method need to provide the logic for judging and converting exception based on its message09:36
Qimingthat is enough09:36
Yanyanhuand also the context09:36
Qimingsurely we can map them to more meaningful exception type names as is done at the client side09:36
Qimingyou mean call stack?09:37
Yanyanhuyes, where the exception happened09:37
xuhaiweiYanyanhu's meaning is we need human work here09:37
Yanyanhuthis is what I mean09:37
xuhaiweithough we got error code and message, the method doesn't know the specific exception type09:38
Yanyanhuthe exception_parse method in client can provide mapping and parsing, but it can judge the meaning of an exception I think09:38
Qimingcould you please check this line:
Yanyanhuyes, this line can help to make exception converting09:39
Qimingthat was an effort to make some conversion for code readability09:40
xuhaiweionly by the code?09:40
Yanyanhuok, so it's just responsbile for code mapping09:40
Yanyanhuthen the output of exutils.parse is SenlinInternalError(code, msg)09:41
Yanyanhusomething like this?09:41
QimingJust SenlinInternalError09:41
Yanyanhuthe this internal exception will be caught in profile/policy to decide whether an exception should be generated and send back to end user09:41
xuhaiweithat is not what we desired i am afraid09:42
Qimingthe InternalError class has code and msg, that was why we have parse() method09:42
Yanyanhuyes, this makes sense to me09:42
xuhaiweibut I am confused09:43
xuhaiweiin upper layer, we catch internalerror and then how to handle it09:43
Qimingcase by case, xuhaiwei09:44
Yanyanhuem, this is what I'm thinking09:44
xuhaiweiI mean when implementing the code, I can't see the code and message09:44
Qimingimplementing which code?09:46
xuhaiweithe handling code in upper layer09:46
Qimingsay we do a flavor_get, flavor_get is invoked from nova.server profile, before creating/booting a nova server, the error code is not that useful in this case,  the only useful message is the 'message' from the InternalError,  we will kill such all exceptions related to flavor_get in the nova server profile, save the 'message' as status_reason, mark status as FAILED and exit09:47
Qimingwe don't need an exception type here09:48
Qimingthere is no further exception thrown09:48
Yanyanhuhaiwei, I think Qiming means the SenlinInteralError itself will contain the status code09:49
Yanyanhuthe upper layer code can get it when capture this SenlinInternalError exception09:49
xuhaiweiand parse it again?09:49
Qimingthe exutils.parse() function will do its best to fill in the 'code', 'message' fields09:50
Yanyanhuand also conatain the message since sometimes the msg should be sent back to user09:50
Qimingfor upper layer code, the only thing they know is SenlinInternalError09:50
Yanyanhuxuhaiwei, yes, I think so09:50
Qimingeither you check the code, either you use the message09:50
Yanyanhuand the second round parsing is case by case09:50
Yanyanhue.g. by the profile/policy's logic09:50
Qimingthey must already be there, or else why do we do parse()?09:50
xuhaiweiin the upper layer, mapping the exception by error message?09:52
xuhaiweisince the error code can be duplicated09:52
Qimingwe may and may not need to map the exception09:52
Yanyanhuxuhaiwei, I think there is no mapping in upper layer, just 'human' exception handling09:52
Qimingit is all up to the location you are receiving the InternalError09:53
xuhaiweiI think I got it now09:53
Yanyanhuhi, Qiming I think haiwei was asking whether the second round handling is automatic ;)09:53
Yanyanhubased on a fixed mapping09:53
Qimingokay, let's put another example to make this clearer09:53
Qimingtake the flavor_get() method as an example09:54
Qimingif we are invoking it during node_creation handling, we don't throw exceptions, we only record status_reason09:54
Qimingsuppose we provide a profile-validate command to user09:55
Qimingin that command, we will check if user provided flavor id/name does exists09:55
Qimingwe will get an InternalError when invoking flavor_get()09:55
Qimingbut we will decide to return a BadRequest or ValidationFailure exception to user09:56
* Qiming is wondering whether he is making things clearer or more vague ...09:57
xuhaiweiit's ok for me up to now09:57
Qimingthe point is: we will treat the same error/exception in different ways, depending on the where you are handling it09:58
Yanyanhu  ...09:58
Yanyanhu  nova_driver.flavor_get(flavor_id)09:58
Yanyanhu  ...09:58
Yanyanhuexcept SenlinInternalError as ex09:58
Yanyanhu  LOG.exception(xxx)09:58
Yanyanhu  raise SenlinBadRequest()09:58
Yanyanhucode in profile may looks like this?09:58
Qimingyes, if it is in validate() path09:59
xuhaiweiI think so09:59
Yanyanhuok, clear about it09:59
Qimingif it is in do_create() path, we will not raise SenlinBadRequest09:59
Yanyanhuyes, since it is in action progress10:00
xuhaiweiyes, sometime, SenlinNotFound maybe10:00
Qimingwe have to combine quite some exception types we have today, :)10:01
Yanyanhumay need to file a bug for this?10:02
xuhaiweithe fewer the better10:02
Yanyanhuor a blueprint?10:02
xuhaiweialready have a bp about the exception handling10:02
Qimingthe author of the HTTP error code specs is a genius10:02
Yanyanhuhaiwei, seems your scope ;)10:02
Qimingthere are not that many cases to handle10:03
xuhaiweimaybe not one person10:03
Qimingby adding new exception types, we are making our own world complicated10:03
xuhaiweimaybe some people just like the three of us10:03
Yanyanhuyep :)10:03
Yanyanhureally need to wc10:04
xuhaiweiI will write something to the exception handling bp10:04
Yanyanhuok, cool10:06
Yanyanhuprepare to leave10:06
YanyanhuI will hold the code of driver and wait for this exception parsing workitem10:06
Yanyanhucode of test case for driver10:06
Yanyanhuwill leave, see U guys tomorrow10:09
xuhaiweisee u10:11
*** Yanyanhu has quit IRC10:13
Qimingwalking home10:19
xuhaiweitake care10:22
*** Qiming has quit IRC10:25
openstackgerritxu-haiwei proposed stackforge/python-senlinclient: Fix profile name update error
*** Qiming has joined #senlin11:30
lixinhui_huge rainfall11:44
lixinhui_qiming, are you caught?11:45
lixinhui_good to know11:46
lixinhui_I need your help on nova-api11:47
lixinhui_from the debug out of nova boot, we can see the process to communicate with nova server11:47
lixinhui_but still do not know how to revise openstacksdk11:48
lixinhui_to reach same goal11:48
lixinhui_<lixinhui_> but nova boot shows complete communication and message body11:48
Qimingopenstacksdk transport will dump its request and response body11:48
Qimingah, I see11:50
Qimingin senlin, there is a concept called action11:50
Qimingall requests, except for some resource list/get requests, are handled by actions11:50
Qimingactions are asynchronously executed by a worker thread inside the senlin-engine11:51
lixinhui_senlin log include all the messages?11:51
Qimingcheck senlin-engin log11:51
Qimingyou won't see them from the command line11:52
*** jruano has joined #senlin11:53
lixinhui_have you once read the code of openstacksdk?11:59
lixinhui_key problem seems here11:59
lixinhui_do you have any idea which file/files we should change to construct 'server': {}, 'os:scheduler_hints':{}12:01
lixinhui_seems openstacksdk use resource to new/create new server but no separated construction available for message body12:02
Qimingscheduler_hints is already sent to nova12:08
Qimingyou need to do a 'nova show' to see if it is already there12:09
lixinhui_the hints do not work12:11
QimingI am not talking about whether it works12:12
QimingI mean you need to check if it is there12:12
lixinhui_no, it does not occur when nova show node12:12
lixinhui_from nova boot debug information, i feel we should construct { 'server': {}, 'os:scheduler_hints':{} }12:14
lixinhui_current message is {'server': { ...'meta':{}, 'scheduler_hints':{}..}..}12:15
Qimingis it request or response?12:15
Qimingthat means the data is passed to nova12:16
lixinhui_ line 612:17
*** jdandrea has joined #senlin12:17
lixinhui_compared to <lixinhui_> line 89...12:19
Qimingcompare what?12:20
lixinhui_REQ body between openstacksdk and nova cli12:20
lixinhui_we should generate nova cli similar REQ body, I think, for scheduler_hints to work12:21
Qimingoh no12:22
Qimingthey have changed that interface ....12:22
lixinhui_we have to reslove this for demo12:22
lixinhui_placement_policy can be a simple one at this stage12:23
*** Qiming has quit IRC12:25
*** Qiming has joined #senlin12:26
Qimingnetwork broken just now12:26
lixinhui_oh, okay12:26
lixinhui_my network often break at home12:26
Qimingit will be passed to nova as-is, sdk won't modify them12:26
lixinhui_who change the interface12:26
Qimingnova changed the way scheduler_hints is sent to the server12:27
Qimingthey are now expecting a 'os:' prefix12:27
lixinhui_because hints do not belong to server from model pespective12:27
lixinhui_I see, but it does not work if only add OS:before scehduler_hints12:33
lixinhui_since others should be [server][XX]12:33
*** mathspanda has joined #senlin12:35
Qimingah yes12:44
Qimingneed a change at the sdk side then12:44
lixinhui_need your help here to understand its straucture12:48
lixinhui_which file/files we should change12:49
lixinhui_feel hard to do that12:49
lixinhui_by check code of compute/v2/ and12:49
lixinhui_I am very hungry now. stomach ache whole day and I did take lunch and dinner, now feel hungry12:51
Qimingneed to discuss with Brian and Terry12:52
lixinhui_please help this as soon as possible.12:52
Qiminggo grab some food then12:52
*** lixinhui_ has quit IRC14:04
*** Qiming_ has joined #senlin14:30
*** Qiming has quit IRC14:33
*** Qiming_ has quit IRC14:47
*** mathspanda has quit IRC15:33
*** jdandrea has left #senlin19:18
openstackgerritMerged stackforge/python-senlinclient: Updated from global requirements
openstackgerritMerged stackforge/senlin: Add a new exception type 'ResourceUpdateFailure'
*** jruano has quit IRC21:15
*** jruano has joined #senlin21:19
*** Qiming_ has joined #senlin23:38
*** Qiming_ has quit IRC23:54

Generated by 2.14.0 by Marius Gedminas - find it at!