[ARVADOS] created: 1.3.0-2248-g9ebf73b1a
Git user
git at public.arvados.org
Thu Mar 5 18:19:41 UTC 2020
at 9ebf73b1a1229bba507057ed2fb6a39635ce7e24 (commit)
commit 9ebf73b1a1229bba507057ed2fb6a39635ce7e24
Author: Tom Clegg <tom at tomclegg.ca>
Date: Thu Mar 5 13:16:43 2020 -0500
16217: Error out if (*pq.Listener)Ping() fails.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/services/ws/event_source.go b/services/ws/event_source.go
index 6ac8e0135..3a82bf62b 100644
--- a/services/ws/event_source.go
+++ b/services/ws/event_source.go
@@ -7,6 +7,8 @@ package main
import (
"context"
"database/sql"
+ "errors"
+ "fmt"
"strconv"
"sync"
"sync/atomic"
@@ -166,11 +168,15 @@ func (ps *pgEventSource) Run() {
case <-ticker.C:
logger(nil).Debug("listener ping")
- ps.pqListener.Ping()
+ err := ps.pqListener.Ping()
+ if err != nil {
+ ps.listenerProblem(-1, fmt.Errorf("pqListener ping failed: %s", err))
+ continue
+ }
case pqEvent, ok := <-ps.pqListener.Notify:
if !ok {
- logger(nil).Debug("pqListener Notify chan closed")
+ logger(nil).Error("pqListener Notify chan closed")
return
}
if pqEvent == nil {
@@ -178,7 +184,7 @@ func (ps *pgEventSource) Run() {
// itself in addition to sending us a
// nil event, so this might be
// superfluous:
- ps.listenerProblem(-1, nil)
+ ps.listenerProblem(-1, errors.New("pqListener Notify chan received nil event"))
continue
}
if pqEvent.Channel != "logs" {
commit 66d3a26aa1f5fbbdcacdd332a56447fd8afd889f
Author: Tom Clegg <tom at tomclegg.ca>
Date: Thu Mar 5 13:12:52 2020 -0500
16217: Close http server before closing listener when shutting down.
Changes log message from "accept tcp ...: use of closed network
connection" to "http: Server closed".
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>
diff --git a/services/ws/server.go b/services/ws/server.go
index 3fb59732e..9747ea1b8 100644
--- a/services/ws/server.go
+++ b/services/ws/server.go
@@ -25,6 +25,7 @@ type server struct {
func (srv *server) Close() {
srv.WaitReady()
srv.eventSource.Close()
+ srv.httpServer.Close()
srv.listener.Close()
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list