From 555d1859296e685f8fed19b44c7f3c38d4583475 Mon Sep 17 00:00:00 2001 From: Matthew Jaffee Date: Fri, 14 Jan 2022 14:01:37 -0600 Subject: [PATCH] add wrapping to differentiate etcd errors we had a CI job fail in an interesting way, but can't tell if the etcd retrying stuff is working, so adding in this wrapping so we can better differentiate the errors if we see it again. Job is here: https://gitlab.com/molecula/featurebase/-/jobs/1977060827 Failure is: ``` === RUN TestClusterStuff cluster_test.go:36: creating index: against http://pilosa2:10101/index/testidx 404 Not Found: 'creating index: sending CreateIndex message: executing request: against http://pilosa3:10101/internal/cluster/message 500 Internal Server Error: 'processing message: getting index: testidx: etcdserver: request timed out '' --- FAIL: TestClusterStuff (8.85s) ``` --- etcd/embed.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etcd/embed.go b/etcd/embed.go index 2e034eb67..db3bc34ea 100644 --- a/etcd/embed.go +++ b/etcd/embed.go @@ -227,12 +227,12 @@ func (e *Etcd) retryClient(fn func(cli *clientv3.Client) error) (err error) { break default: // nil, or an error we don't know about - return err + return errors.Wrap(err, "non-retryable error") } } // if we got here, we got a total of three of some combination of // ErrTimeout or ErrLeaderChanged, and we're giving up. - return err + return errors.Wrap(err, "exhausted all retries") } func parseOptions(opt Options) *embed.Config {