search for: virhashaddorupdateentry

Displaying 4 results from an estimated 4 matches for "virhashaddorupdateentry".

2018 Apr 04
2
Re: error : virHashForEach:597 : Hash operation not allowed during iteration
...; domain list from multiple threads. Looking a bit more, the whole "iterating" bit is currently unsafe. First, it is racy since it's "check then take". Two threads may check the value is false and start iterating both. Moreover, at some places, it is not set, for example in virHashAddOrUpdateEntry(). So, it would be possible to call this function and during the update to iterate over the hash. This seems to be prevented only by callers using RW lock. So, it seems we can just remove this "iterating" bool and just check all users of these functions are using the appropriate lock. --...
2018 Apr 04
0
Re: error : virHashForEach:597 : Hash operation not allowed during iteration
...ple threads. > > Looking a bit more, the whole "iterating" bit is currently > unsafe. First, it is racy since it's "check then take". Two threads may > check the value is false and start iterating both. Moreover, at some > places, it is not set, for example in virHashAddOrUpdateEntry(). So, it > would be possible to call this function and during the update to iterate > over the hash. This seems to be prevented only by callers using RW > lock. So, it seems we can just remove this "iterating" bool and just > check all users of these functions are using the a...
2018 Apr 04
2
Re: error : virHashForEach:597 : Hash operation not allowed during iteration
...; >> Looking a bit more, the whole "iterating" bit is currently >> unsafe. First, it is racy since it's "check then take". Two threads may >> check the value is false and start iterating both. Moreover, at some >> places, it is not set, for example in virHashAddOrUpdateEntry(). So, it >> would be possible to call this function and during the update to iterate >> over the hash. This seems to be prevented only by callers using RW >> lock. So, it seems we can just remove this "iterating" bool and just >> check all users of these functions...
2018 Apr 04
2
Re: error : virHashForEach:597 : Hash operation not allowed during iteration
❦ 4 avril 2018 15:19 +0200, Michal Privoznik <mprivozn@redhat.com> : > Both threads call virHashForEach(table=0x7f92fc69a480). Thread 6 was > first so it starts iterating and sets table->iterating so later when > thread 10 enters the function an error is reported. > > I guess we can go with what Dan suggested and after some rework we can > just drop ->iterating