[libvirt] hash: failed on concurrent iterating.

Michal Privoznik mprivozn at redhat.com
Wed Apr 4 11:22:41 UTC 2018


On 04/04/2018 11:50 AM, Zhangzijian wrote:
>> -----Original Message-----
>> From: libvir-list-bounces at redhat.com [mailto:libvir-list-bounces at redhat.com]
>> On Behalf Of Michal Privoznik
>> Sent: Wednesday, April 04, 2018 5:21 PM
>> To: zhangzijian (Cloud); libvir-list at redhat.com
>> Cc: huangyong (Cloud)
>> Subject: Re: [libvirt] hash: failed on concurrent iterating.
>>
>> On 04/04/2018 11:10 AM, Zhangzijian wrote:
>>> In function 'virHashForEach/virHashSearch', 'table->iterating' prevent
>> concurrent iterating. But most caller evoke it, after hold a read lock.
>>> This will lead the second caller failed to iterate the table. So, the caller should
>> hold a write lock, then iterate the table.
>>
>> Looks like there's another thread discussing this issue:
>>
> 
> Yes, the issue is still exist in v4.2.0.
> Is it applicable to using write lock instead?

Do you have a stack trace to share?

Michal




More information about the libvir-list mailing list