Friday, 2015-10-16

*** jdandrea has joined #senlin00:05
*** shu has joined #senlin00:08
*** xuhaiwei has joined #senlin00:08
*** lixinhui has joined #senlin00:09
*** lixinhui has quit IRC00:13
*** pratikmallya has joined #senlin00:14
*** yuanying has joined #senlin00:14
*** openstackgerrit has joined #senlin00:15
*** pratikmallya has quit IRC00:17
*** lixinhui has joined #senlin00:36
*** lixinhui has quit IRC00:41
*** jdandrea has quit IRC00:53
*** Qiming_ has quit IRC01:00
*** lixinhui has joined #senlin01:03
*** lixinhui has quit IRC01:08
*** zhenguo has joined #senlin01:10
*** elynn has joined #senlin01:13
*** mathspanda has joined #senlin01:15
*** lawrancejing has joined #senlin01:18
elynnmorning01:22
xuhaiweimorning01:26
*** lixinhui has joined #senlin01:31
*** Liu has joined #senlin01:34
lawrancejingmorning01:58
*** Qiming_ has joined #senlin02:03
Qiming_morning02:04
Liumorning~~02:08
Liuthanks for your help about my patch.02:09
*** Yanyanhu has joined #senlin02:24
*** Yanyan has joined #senlin02:24
*** Yanyanhu has quit IRC02:28
*** hightall has joined #senlin02:28
hightallhi, xin hui02:29
*** Qiming_ is now known as Qiming02:29
lixinhuiHi Hightall02:31
Yanyanhi, hightall, welcome ;)02:32
Yanyanhi, Qiming, xuhaiwei, are you free for a quick talk?02:32
Qimingyes02:32
xuhaiweisure02:32
YanyanI just read haiwei's patch about grace_period https://review.openstack.org/#/c/234736/02:33
hightallI encountered a problem, Qiming tell me that you know it, it's glance client request, and got AttributeError: id02:33
hightallI request a image info, but response some header, but no body info.02:33
YanyanI'm now a litte confused about the meaning of 'grace_period'02:33
*** Yanyan is now known as yanyanhu02:34
xuhaiweimy understanding is 'rest for a while'02:34
hightallDo you know how to fix?02:34
yanyanhuI thought it means the smallest period between two node deletion operations?02:34
Qiminghttp://git.openstack.org/cgit/stackforge/senlin/tree/senlin/policies/deletion_policy.py#n9702:34
yanyanhuyes, but rest for a while for what? for a node deletion or any cluster action that includes node(s) deletion operation?02:35
Qimingit is a slack time granted to each node before the real deletion happens02:35
yanyanhuso it means the duration between two node deletion02:35
Qimingno02:35
Qimingit is a slack time granted to each node before the real deletion happens02:36
yanyanhuhi, hightall, so normaly, the resp should include body?02:36
Qimingfor any node deletion, we don't want to be that brutal02:36
hightallyes02:36
xuhaiweiso I just added a sleep before the deletion action happens02:36
Qimingthere might be some on-going transactions that will either timeout or get completed in a few seconds02:36
yanyanhuok, I see.02:37
Qimingit has nothing to do with the "interval" between two node deletion actions02:37
yanyanhuso user themself should be aware how many seconds should be spent on waiting before a node(s) deletion is really started02:37
Qimingyes02:38
yanyanhuand use this second count to set grace_period02:38
yanyanhuok, understand02:38
Qimingby default, we just kill them right away02:38
yanyanhuyes02:38
*** hightall has quit IRC02:40
Qimingyet another property to handle02:42
Qiming"reduce_desired_capacity"02:42
xuhaiweigot it02:43
openstackgerritMerged stackforge/senlin: Make 'grace_period' and 'destroy_after_deletion' work  https://review.openstack.org/23473602:43
Qimingif you search this: http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl02:44
Qimingtry find "ShouldDecrementDesiredCapacity" in that file02:44
Qimingyou will find this:02:44
lixinhuihightall, I met that problem before02:44
Qiming<xs:element name="DetachInstances">02:45
Qiming<xs:complexType>02:45
Qiming<xs:sequence>02:45
Qiming<xs:element name="InstanceIds" type="tns:InstanceIds" minOccurs="0"/>02:45
Qiming<xs:element name="AutoScalingGroupName" type="tns:ResourceName"/>02:45
Qiming<xs:element name="ShouldDecrementDesiredCapacity" type="xs:boolean"/>02:45
Qiming</xs:sequence>02:45
lixinhuimy solution is to reinstall requests == 2.5.202:45
Qiming</xs:complexType>02:45
Qiming</xs:element>02:45
Qiminghightall went offline02:45
Qimingand also this:02:45
Qiming<xs:element name="TerminateInstanceInAutoScalingGroup">02:45
Qiming<xs:complexType>02:45
Qiming<xs:sequence>02:45
Qiming<xs:element name="InstanceId" type="tns:XmlStringMaxLen16"/>02:45
Qiming<xs:element name="ShouldDecrementDesiredCapacity" type="xs:boolean"/>02:45
Qiming</xs:sequence>02:45
Qiming</xs:complexType>02:45
Qiming</xs:element>02:45
*** hightall has joined #senlin02:46
lixinhuihightall, please try to reinstall you requests as 2.5.202:47
xuhaiweiQiming, you are saying to me?02:49
xuhaiweiI will check it later02:50
yanyanhuxuhaiwei, this is a property we need to make further thought about02:50
hightallthx very much, it's fine now, lixinhui02:51
Qimingxuhaiwei, yes, those are the use cases for "reduce_desired_capacity"02:51
xuhaiweieveryone, I want to ask a python question here02:52
xuhaiweia little strange to me02:52
xuhaiweilist=["a", "b", "c"]02:52
xuhaiweifor d in list:02:52
Qimingdon't use 'list'02:53
Qimingthat is a builtin keyword02:53
Qiminggo ahead02:53
xuhaiwei  if len(d)==1:02:53
xuhaiwei  list.remove(d)02:54
Qimingoh, another bad practice here02:54
xuhaiweinever deleted all the elements02:54
Qimingyou are modifying a list in-place02:54
Qimingyou are actually doing a filtering on an existing list02:55
xuhaiweithe list is modified during loop?02:55
Qimingthe safest way is to make a copy02:55
Qimingyes, I think so, I tried similar things before02:55
Qimingit is dangerous IMO, may lead to subtle issues later02:56
yanyanhucopy.deepcopy02:56
Qimingcopy.deepcopy won't solve it I'm afraid02:56
xuhaiweibut if I use:  "for d in list[:]: "  it works fine02:56
Qimingyou are still manipulating a list in-place02:56
yanyanhuyou mean the 'list' object?02:57
xuhaiweiL = ["a", "b"]02:58
Qimingyes, deepcopy is making a new copy02:58
xuhaiweifor d in L:02:58
Qimingyou will still need to solve the in-place editing problem02:58
xuhaiwei if len(d) == 1:02:58
xuhaiwei   d.remove(d)02:59
Qimingalist = ['a', 'ab', 'abc']; blist = [d for d in alist if len(d) == 1]; print(alist); print(blist)02:59
yanyanhud.remove()?02:59
Qimingthis works02:59
Qimingif you are modifying the list inside a "for" loop, that list becomes very fragile at least03:00
xuhaiweiL=["a", "b"]; for d in L[:]: if len(d) == 1: L.remove(d)    this also works, so L[:] is making a copy?03:00
Qimingit may work, I would say, but very unsafe03:01
xuhaiweiok03:01
yanyanhuumm, so correct way is to avoid revising the list object itself inside the loop?03:02
Qimingthat is my suggestion03:02
yanyanhubuild a new list for output03:02
yanyanhuok03:02
Qimingyou can check stackoverflow and see if there are better practices03:02
Qiminghttps://review.openstack.org/#/c/233551/1/senlin/policies/region_placement.py03:03
Qimingline 14203:03
QimingI tried to remove an item from self.regions directly, in the way xuhaiwei proposed above03:03
Qimingit never succeeded03:03
yanyanhuem, understand03:04
yanyanhuguess the limitation of python language03:04
QimingI actually got an error, the data has been changed during iteration03:04
xuhaiweithat is not python's bug :)03:04
Qiminganother way, as LiuWei was trying before03:04
xuhaiwei?03:04
Qimingdo iteration from the end of the list, set step to -103:05
Qimingthat is probably making the code a lot difficult to consume I think03:05
Qimingsee this: https://review.openstack.org/#/c/221684/6/senlin/policies/crossaz_policy.py03:06
Qimingline 18903:06
Qimingit is not a good practice to delete items from a list using a loop, we never know how the index are maintained by python03:07
openstackgerritOpenStack Proposal Bot proposed stackforge/python-senlinclient: Updated from global requirements  https://review.openstack.org/23569603:07
openstackgerritOpenStack Proposal Bot proposed stackforge/senlin: Updated from global requirements  https://review.openstack.org/23468103:07
yanyanhuem, will be careful about similar case03:08
Qimingsounds a very basic problem, but when you hit it, you realize ... umm, not such a trivial case, :)03:08
yanyanhuyea03:09
xuhaiweiif you don't mind, I will show another case03:14
xuhaiweithis is really confused me03:14
xuhaiweihttp://paste.openstack.org/show/476446/03:15
xuhaiweitry to run this, don't know what is the reason03:16
xuhaiweilunch time for me, but still wait for the answer from the python master :)03:17
yanyanhuwill check it :)03:18
openstackgerritCindia-blue proposed stackforge/senlin: Zone placement policy  https://review.openstack.org/22168403:38
*** mathspanda has quit IRC03:49
*** gongysh has joined #senlin03:56
openstackgerritCindia-blue proposed stackforge/senlin: Zone placement policy  https://review.openstack.org/22168404:41
openstackgerritxu-haiwei proposed stackforge/senlin: Revise cluster_add_nodes action  https://review.openstack.org/23572804:58
openstackgerritxu-haiwei proposed stackforge/senlin: Revise cluster_add_nodes action  https://review.openstack.org/23572805:03
yanyanhuhi, xuhaiwei, about http://paste.openstack.org/show/476446/05:17
yanyanhud is not a gloabl variable?05:17
xuhaiweiI dont know the reason in fact05:19
xuhaiweibut if you change 'd' to d[0] it works05:19
xuhaiweichange 'd' to a list type, will pass05:20
yanyanhuoh, my mistake, I didn't read the code carefully05:20
yanyanhulet me check it again05:21
yanyanhuso there should be another line before the code define d as a list?05:22
yanyanhuNameError: name 'd' is not defined05:23
xuhaiweino05:23
yanyanhuhttp://paste.openstack.org/show/476448/05:25
yanyanhuso you expect d is 1?05:25
xuhaiweiyes05:26
yanyanhuhttp://paste.openstack.org/show/476449/05:26
yanyanhuthis paste05:26
yanyanhuresult of print is 105:26
yanyanhubut maybe this is not what you want?05:27
xuhaiweiif fact  I want the action_data() method to run to times, the first time return 'succeed' and the secound time return 'failed'05:27
yanyanhuwhy twice?05:27
yanyanhuin your original code, if we ignore the global variable problem, action_data is only executed once I think05:28
xuhaiweisee this http://git.openstack.org/cgit/stackforge/senlin/tree/senlin/tests/unit/engine/actions/test_cluster_action.py#n109305:29
yanyanhuand action_data's return value is the reference of the inner function get_data()05:29
xuhaiweithis is a test case I recently wrote, I want the mock to return different values when called two times05:32
yanyanhuyes, if you want to execute a segment of code as side effect, you can define it like this05:32
xuhaiweibut if I change 'd' to a variable, it doesnt wokr05:33
xuhaiweiwork05:33
xuhaiweiyou can ignore this if you don't have time :)05:34
yanyanhuit's ok since I also don't know why :)05:35
yanyanhuI want to understand it05:35
xuhaiweiyou can change 'd' to a variable and run the test case05:36
yanyanhuok05:37
xuhaiweiQiming, about the patch I submit just now, I am sorry to make the same mistake05:38
Qimingthat's fine05:39
Qimingno worry05:39
xuhaiweibut if we will check inside the action, I think we don't need to do it in the service layer05:39
Qimingsometimes we do additional checks05:39
Qimingbecause they are at different layers05:39
Qimingyes, some of them are not necessary05:39
xuhaiweilike you have said, if other actions have changed the node's property, that check might be dangerous05:40
xuhaiweinot just necessary05:41
xuhaiweinot just not necessary05:41
Qimingkind of05:43
xuhaiweithis is a difficult situation we face, if we just check them in the action, and if the action fails there is no response to the client side immediately, so the check in service layer is helpful05:47
Qimingsome early checks would be helpful05:49
Qimingbut we don't know if situation has changed when we are in the action handler, so we checked it again05:50
xuhaiweiok05:50
xuhaiweianother problem is should we allow a cluster owned node to be added to the cluster again?05:51
Qimingthat seems a waste05:59
Qimingno action will be taken06:00
Qimingneed to revisit the code to see if we allow that to happen, whether its index will be reassigned06:00
Qimingcannot recall clearly06:00
xuhaiweiyes, just don't do anything, there is a situation like user want to add two nodes, one is already cluster member, the other is not, we should not make this action fail I think06:01
*** Liu has quit IRC06:01
Qimingokay, we can ignore those nodes if desired06:06
openstackgerritYanyan Hu proposed stackforge/senlin: Make node related DB queries project safe  https://review.openstack.org/23518206:10
*** lawrancejing has quit IRC06:24
*** lawrancejing has joined #senlin06:25
openstackgerritYanyan Hu proposed stackforge/senlin: Make node related DB queries project safe  https://review.openstack.org/23518206:30
openstackgerritYanyan Hu proposed stackforge/senlin: Make all cluster DB queries project_safe  https://review.openstack.org/23468306:30
*** Liu has joined #senlin07:03
*** lawrancejing has quit IRC07:20
*** lawrancejing has joined #senlin07:21
*** lawrancejing has quit IRC07:22
*** Yanyan has joined #senlin07:26
*** yanyanhu has quit IRC07:26
*** xuhaiwei has quit IRC07:29
*** Shijia has joined #senlin07:38
*** Shijia has quit IRC07:46
openstackgerritxu-haiwei proposed stackforge/senlin: Allow cluster member nodes to be added to the cluster  https://review.openstack.org/23572807:46
*** Shijia has joined #senlin07:46
*** xuhaiwei has joined #senlin07:49
openstackgerritMerged stackforge/senlin: Make all cluster DB queries project_safe  https://review.openstack.org/23468307:52
*** Shijia has quit IRC08:07
*** Shijia has joined #senlin08:07
*** Liu has quit IRC08:20
*** Bell3456 has joined #senlin08:50
*** Bell3456 has left #senlin08:52
openstackgerritQiming Teng proposed stackforge/python-senlinclient: Strips off the quotes when showing nested table  https://review.openstack.org/23460809:04
*** hightall has quit IRC09:29
*** Yanyan has quit IRC09:36
*** elynn has quit IRC09:54
*** zhenguo has quit IRC10:02
*** Qiming_ has joined #senlin10:05
*** Qiming has quit IRC10:08
*** Qiming_ is now known as Qiming10:12
*** Qiming has quit IRC10:44
*** shu has left #senlin11:21
*** lixinhui has quit IRC11:44
*** Qiming has joined #senlin11:48
*** lawrancejing has joined #senlin12:28
*** Qiming_ has joined #senlin12:30
*** Qiming has quit IRC12:30
openstackgerritMerged stackforge/senlin-dashboard: Add node creation unit test  https://review.openstack.org/23529812:32
openstackgerritMerged stackforge/senlin-dashboard: Improve profile update form  https://review.openstack.org/23531212:34
openstackgerritMerged stackforge/senlin-dashboard: Add node details overview page  https://review.openstack.org/23535912:34
openstackgerritMerged stackforge/senlin-dashboard: Add node details overview page  https://review.openstack.org/23535912:34
openstackgerritMerged stackforge/senlin-dashboard: Add cluster creation unit test  https://review.openstack.org/23532612:35
*** lawrancejing has quit IRC12:37
*** Shijia_ has joined #senlin12:48
*** Shijia has quit IRC12:50
*** Shijia_ has quit IRC13:03
*** Shijia has joined #senlin13:03
*** Shijia has quit IRC13:11
*** pratikmallya has joined #senlin14:17
*** pratikma_ has joined #senlin14:20
*** pratikmallya has quit IRC14:23
*** hightall has joined #senlin14:45
*** Shijia has joined #senlin15:13
*** Shijia has quit IRC15:22
*** pratikma_ has quit IRC15:27
*** pratikmallya has joined #senlin15:34
*** hightall has quit IRC15:57
*** pratikma_ has joined #senlin16:18
*** pratikmallya has quit IRC16:20
*** Shijia has joined #senlin16:21
*** Shijia has quit IRC16:27
*** Qiming_ has quit IRC16:40
*** pratikmallya has joined #senlin16:53
*** pratikma_ has quit IRC16:56
*** Shijia has joined #senlin17:26
*** Shijia has quit IRC17:32
*** pratikma_ has joined #senlin18:12
*** pratikmallya has quit IRC18:15
*** Shijia has joined #senlin18:32
*** Shijia has quit IRC18:37
*** Shijia has joined #senlin19:37
*** pratikma_ has quit IRC19:41
*** pratikmallya has joined #senlin19:42
*** Shijia has quit IRC19:42
*** pratikmallya has quit IRC22:01
*** pratikmallya has joined #senlin22:10
*** pratikmallya has quit IRC23:55

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