From 82e7d4fe18d450b2d43d476b704dc3ef1d155184 Mon Sep 17 00:00:00 2001 From: Andrew Stucki Date: Mon, 5 Jun 2023 11:49:30 -0400 Subject: [PATCH 1/3] Fix up case where subscription is terminated due to ACLs changing or a snapshot restore occurring --- agent/proxycfg-glue/glue.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/agent/proxycfg-glue/glue.go b/agent/proxycfg-glue/glue.go index 03afd5c155c4..41060119b319 100644 --- a/agent/proxycfg-glue/glue.go +++ b/agent/proxycfg-glue/glue.go @@ -141,6 +141,12 @@ func newUpdateEvent(correlationID string, result any, err error) proxycfg.Update if acl.IsErrNotFound(err) { err = proxycfg.TerminalError(err) } + // these are also errors where we should mark them + // as terminal for the sake of proxycfg, since they require + // a resubscribe. + if err == stream.ErrSubForceClosed || err == stream.ErrShuttingDown { + err = proxycfg.TerminalError(err) + } return proxycfg.UpdateEvent{ CorrelationID: correlationID, Result: result, From 45008e27c356321d7c94b23b165cce1b04a5dfb3 Mon Sep 17 00:00:00 2001 From: Andrew Stucki Date: Mon, 5 Jun 2023 11:56:47 -0400 Subject: [PATCH 2/3] Add changelog entry --- .changelog/17566.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17566.txt diff --git a/.changelog/17566.txt b/.changelog/17566.txt new file mode 100644 index 000000000000..f15718bd7601 --- /dev/null +++ b/.changelog/17566.txt @@ -0,0 +1,3 @@ +```release-note:bug +xds: Fixed a bug where modifying ACLs on a token being actively used for an xDS connection caused all xDS updates to fail. +``` From bdee9e3b9858ca9b654de853bcb4c77d8f14843e Mon Sep 17 00:00:00 2001 From: Andrew Stucki Date: Mon, 5 Jun 2023 12:09:32 -0400 Subject: [PATCH 3/3] Switch to use errors.Is --- agent/proxycfg-glue/glue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/proxycfg-glue/glue.go b/agent/proxycfg-glue/glue.go index 41060119b319..320d2fc25804 100644 --- a/agent/proxycfg-glue/glue.go +++ b/agent/proxycfg-glue/glue.go @@ -5,6 +5,7 @@ package proxycfgglue import ( "context" + "errors" "github.com/hashicorp/go-hclog" "github.com/hashicorp/go-memdb" @@ -144,7 +145,7 @@ func newUpdateEvent(correlationID string, result any, err error) proxycfg.Update // these are also errors where we should mark them // as terminal for the sake of proxycfg, since they require // a resubscribe. - if err == stream.ErrSubForceClosed || err == stream.ErrShuttingDown { + if errors.Is(err, stream.ErrSubForceClosed) || errors.Is(err, stream.ErrShuttingDown) { err = proxycfg.TerminalError(err) } return proxycfg.UpdateEvent{