From e19fef7c88c79b7d0dfc9d7dcd2d271a39696143 Mon Sep 17 00:00:00 2001 From: Arthur de Kerhor Date: Thu, 24 Jun 2021 19:39:44 +0200 Subject: stats: fix race conditions in vpp-api stats client Type: fix Signed-off-by: Arthur de Kerhor Signed-off-by: Dave Wallace Change-Id: Ie5c197f6ec0d41d5e405b22662701d83ad94d29e (cherry picked from commit c9ae8cfaccd75fbc2dc27bdebccdbd14fc0cb60c) --- src/vpp-api/python/vpp_papi/vpp_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit 1.2.3-korg