WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] race condition during /etc/xensource/scripts/vif call

To: George Shuklin <george.shuklin@xxxxxxxxx>
Subject: Re: [Xen-API] race condition during /etc/xensource/scripts/vif call
From: Jonathan Ludlam <Jonathan.Ludlam@xxxxxxxxxxxxx>
Date: Sun, 25 Sep 2011 23:19:59 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 25 Sep 2011 15:20:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4E7BF73B.4050302@xxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <1316704687.3692.11.camel@X220> <B1B04DE6-FBED-49F4-A048-70D132E058A4@xxxxxxxxxxxxx> <4E7BF73B.4050302@xxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acx70UP4iP+RU3NrTimFjoDvEveV7A==
Thread-topic: [Xen-API] race condition during /etc/xensource/scripts/vif call
Try doing the xenstore-ls before the xenstore-rm to see whether it's definitely 
a race or not. 

Jon

On 23 Sep 2011, at 04:04, George Shuklin wrote:

> Ok, may be I was wrong and shall not use any /xapi keys on interface 
> remove. Right now I switched from xapi usage to '$vsctl port-to-br'. But 
> any way, this is kinda strange - why /xapi entery dissapear before 
> interface completely shutdown?
> 
> On 23.09.2011 03:07, Jonathan Ludlam wrote:
>> Interesting - it might be that you're racing with xapi - it's waiting for 
>> the hot plug key to be removed, which is what the xenstore-rm does. Have a 
>> look here:
>> 
>> https://github.com/xen-org/xen-api/blob/master/ocaml/xenops/device.ml#L752
>> 
>> (Note that this is more current than XCP 1.0 or 1.1, but the general gist is 
>> the same)
>> 
>> Jon
>> 
>> On 22 Sep 2011, at 16:18, George Shuklin wrote:
>> 
>>> Good day.
>>> 
>>> Found strange situation for VM with two or more interfaces: data
>>> from /xapi for domain disappear before vif remove called second time.
>>> 
>>> Here little patch to vif script (against XCP 1.1 beta) to log XenStore
>>> state:
>>> 
>>> --- vif.orig        2011-05-19 02:32:19.000000000 +0400
>>> +++ vif     2011-09-22 19:11:10.000000000 +0400
>>> @@ -227,6 +227,8 @@
>>>         xenstore-rm "${HOTPLUG}/hotplug"
>>>     fi
>>>     logger -t scripts-vif "${dev} has been removed"
>>> +    echo ====domid=$DOMID=====>>/var/log/vif-race.log
>>> +    xenstore-ls /xapi>>/var/log/vif-race.log
>>>     remove_from_bridge
>>>     ;;
>>> esac
>>> 
>>> 
>>> To see 'strange' add to any vm two interfaces and reboot it.
>>> 
>>> In vif-race.log for second time vif call:
>>> ====domid=3=====
>>> 0 = ""
>>> hotplug = ""
>>>  vbd = ""
>>> private = ""
>>>  vbd = ""
>>>   51712 = ""
>>>    ref = "OpaqueRef:1a7992ae-a645-acc6-bf51-3a0202bdd4c7"
>>> frontend = ""
>>>  vbd = ""
>>> 3:
>>> 
>>> (no data for domid 3).
>>> 
>>> I'm not sure if this is a really serious bug, but I found my
>>> antispoofing patch does not remove rules from OVS for multihomed VM's
>>> due lack of 'bridge' variable for VIF (I'm calling remove_restiction()
>>> function in 'remove' case in vif script).
>>> 
>>> I got this bug in XCP 1.0 and XCP1.1 beta.
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> xen-api mailing list
>>> xen-api@xxxxxxxxxxxxxxxxxxx
>>> http://lists.xensource.com/mailman/listinfo/xen-api
>> 
>> _______________________________________________
>> xen-api mailing list
>> xen-api@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/mailman/listinfo/xen-api
> 
> _______________________________________________
> xen-api mailing list
> xen-api@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/mailman/listinfo/xen-api


_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api

<Prev in Thread] Current Thread [Next in Thread>