diff --git a/src/vpp-api/client/stat_client.c b/src/vpp-api/client/stat_client.c
index 3d1bffc..54d6db6 100644
--- a/src/vpp-api/client/stat_client.c
+++ b/src/vpp-api/client/stat_client.c
@@ -177,7 +177,8 @@
   /* Has directory been update? */
   if (sm->shared_header->epoch != sm->current_epoch)
     return 0;
-  stat_segment_access_start (&sa, sm);
+  if (stat_segment_access_start (&sa, sm))
+    return 0;
   ep = vec_elt_at_index (sm->directory_vector, STAT_COUNTER_HEARTBEAT);
   if (!stat_segment_access_end (&sa, sm))
     return 0.0;
@@ -336,7 +337,8 @@
 	}
     }
 
-  stat_segment_access_start (&sa, sm);
+  if (stat_segment_access_start (&sa, sm))
+    return 0;
 
   stat_segment_directory_entry_t *counter_vec = get_stat_vector_r (sm);
   for (j = 0; j < vec_len (counter_vec); j++)
@@ -389,7 +391,9 @@
   if (sm->shared_header->epoch != sm->current_epoch)
     return 0;
 
-  stat_segment_access_start (&sa, sm);
+  if (stat_segment_access_start (&sa, sm))
+    return 0;
+
   for (i = 0; i < vec_len (stats); i++)
     {
       /* Collect counter */
@@ -444,7 +448,8 @@
   stat_segment_data_t *res = 0;
   stat_segment_access_t sa;
 
-  stat_segment_access_start (&sa, sm);
+  if (stat_segment_access_start (&sa, sm))
+    return 0;
 
   /* Collect counter */
   ep = vec_elt_at_index (sm->directory_vector, index);
@@ -472,7 +477,8 @@
   /* Has directory been update? */
   if (sm->shared_header->epoch != sm->current_epoch)
     return 0;
-  stat_segment_access_start (&sa, sm);
+  if (stat_segment_access_start (&sa, sm))
+    return 0;
   vec = get_stat_vector_r (sm);
   ep = vec_elt_at_index (vec, index);
   if (!stat_segment_access_end (&sa, sm))
diff --git a/src/vpp-api/client/stat_client.h b/src/vpp-api/client/stat_client.h
index 97a21dd..052d969 100644
--- a/src/vpp-api/client/stat_client.h
+++ b/src/vpp-api/client/stat_client.h
@@ -23,6 +23,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <vlib/counter_types.h>
+#include <time.h>
 #include <stdbool.h>
 #include <vpp/stats/stat_segment_shared.h>
 
@@ -51,6 +52,7 @@
   stat_segment_shared_header_t *shared_header;
   stat_segment_directory_entry_t *directory_vector;
   ssize_t memory_size;
+  uint64_t timeout;
 } stat_client_main_t;
 
 extern stat_client_main_t stat_client_main;
@@ -88,17 +90,51 @@
   uint64_t epoch;
 } stat_segment_access_t;
 
-static inline void
+/*
+ * Returns 0 on success, -1 on failure (timeout)
+ */
+static inline uint64_t
+_time_now_nsec (void)
+{
+  struct timespec ts;
+  clock_gettime (CLOCK_REALTIME, &ts);
+  return 1e9 * ts.tv_sec + ts.tv_nsec;
+}
+
+static inline int
 stat_segment_access_start (stat_segment_access_t * sa,
 			   stat_client_main_t * sm)
 {
   stat_segment_shared_header_t *shared_header = sm->shared_header;
+  uint64_t max_time;
+
   sa->epoch = shared_header->epoch;
-  while (shared_header->in_progress != 0)
-    ;
+  if (sm->timeout)
+    {
+      max_time = _time_now_nsec () + sm->timeout;
+      while (shared_header->in_progress != 0 && _time_now_nsec () < max_time)
+	;
+    }
+  else
+    {
+      while (shared_header->in_progress != 0)
+	;
+    }
   sm->directory_vector = (stat_segment_directory_entry_t *)
     stat_segment_pointer (sm->shared_header,
 			  sm->shared_header->directory_offset);
+  if (sm->timeout)
+    return _time_now_nsec () < max_time ? 0 : -1;
+  return 0;
+}
+
+/*
+ * set maximum number of nano seconds to wait for in_progress state
+ */
+static inline void
+stat_segment_set_timeout_nsec (stat_client_main_t * sm, uint64_t timeout)
+{
+  sm->timeout = timeout;
 }
 
 static inline bool
