aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/vpp_stats.py
diff options
context:
space:
mode:
authorArthur de Kerhor <arthurdekerhor@gmail.com>2021-06-24 19:39:44 +0200
committerDave Wallace <dwallacelf@gmail.com>2021-06-25 08:35:55 -0400
commite19fef7c88c79b7d0dfc9d7dcd2d271a39696143 (patch)
tree46c503b857dceda47a8e048c03fe532d56323ab0 /src/vpp-api/python/vpp_papi/vpp_stats.py
parentc5111d4fa0246ed5732b91a4449b2466ec01daf3 (diff)
stats: fix race conditions in vpp-api stats client
Type: fix Signed-off-by: Arthur de Kerhor <arthurdekerhor@gmail.com> Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: Ie5c197f6ec0d41d5e405b22662701d83ad94d29e (cherry picked from commit c9ae8cfaccd75fbc2dc27bdebccdbd14fc0cb60c)
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_stats.py')
-rwxr-xr-xsrc/vpp-api/python/vpp_papi/vpp_stats.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 884a30019f8..376eb8cdfa2 100755
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -187,12 +187,12 @@ class VPPStats():
while True:
try:
with self.lock:
+ self.last_epoch = self.epoch
for i, direntry in enumerate(StatsVector(self, self.directory_vector, self.elementfmt)):
path_raw = direntry[2].find(b'\x00')
path = direntry[2][:path_raw].decode('ascii')
directory[path] = StatsEntry(direntry[0], direntry[1])
directory_by_idx[i] = path
- self.last_epoch = self.epoch
self.directory = directory
self.directory_by_idx = directory_by_idx