From 69ae4aa024367edeb18538797677a65d12f296af Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Sun, 1 Jan 2017 12:38:31 +0000 Subject: [PATCH] cmd/syncthing: Avoid Keepalive/GUI refresh race This avoids unnecessary browser request failures and retries. Eg: - Browser reuses existing HTTP connection for GUI refresh request - Server closes connection with request in flight - Browser retries GET request. GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3854 --- cmd/syncthing/gui.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 7fb701c59..85e1969f9 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -326,8 +326,10 @@ func (s *apiService) Serve() { handler = debugMiddleware(handler) srv := http.Server{ - Handler: handler, - ReadTimeout: 10 * time.Second, + Handler: handler, + // ReadTimeout must be longer than SyncthingController $scope.refresh + // interval to avoid HTTP keepalive/GUI refresh race. + ReadTimeout: 15 * time.Second, } s.fss = newFolderSummaryService(s.cfg, s.model)