From caaab974c8954208ddca0ede1d2620b1aec97a1c Mon Sep 17 00:00:00 2001
From: Benjamin Wenger <ben@elixxir.ioo>
Date: Thu, 28 Jan 2021 09:45:20 -0800
Subject: [PATCH] properly handled failed polling state updates and increased
 the buffer size

---
 cmd/poll.go      | 8 +++++++-
 storage/state.go | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cmd/poll.go b/cmd/poll.go
index c6a24dc6..8ceb647b 100644
--- a/cmd/poll.go
+++ b/cmd/poll.go
@@ -153,9 +153,15 @@ func (m *RegistrationImpl) Poll(msg *pb.PermissioningPoll, auth *connect.Auth,
 	if updateNotification.ToActivity == current.ERROR {
 		updateNotification.Error = msg.Error
 	}
+	err = m.State.SendUpdateNotification(updateNotification)
+	if err!=nil{
+		jww.WARN.Printf("Failed to send update notification, " +
+			"is the update thread running?")
+		n.GetPollingLock().Unlock()
+	}
 
 	// Update occurred, report it to the control thread
-	return response, m.State.SendUpdateNotification(updateNotification)
+	return response, err
 }
 
 // PollNdf handles the client polling for an updated NDF
diff --git a/storage/state.go b/storage/state.go
index 96eb0fbe..ffa96c7d 100644
--- a/storage/state.go
+++ b/storage/state.go
@@ -25,7 +25,7 @@ import (
 	"time"
 )
 
-const updateBufferLength = 1000
+const updateBufferLength = 10000
 
 // NetworkState structure used for keeping track of NDF and Round state.
 type NetworkState struct {
-- 
GitLab