mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 08:55:24 +00:00
Disable storage of errors (#3066)
This is a temporary mitigation for the issue described in #3065. The intent is to merge this, cut a 4.6.1 release, and then come up with a more comprehensive solution for 4.7.0.
This commit is contained in:
parent
0cca889dd3
commit
e04f210f51
@ -52,6 +52,13 @@ func NewHandler(ctx context.Context, pool fleet.RedisPool, logger kitlog.Logger,
|
||||
ttl: ttl,
|
||||
}
|
||||
runHandler(ctx, eh)
|
||||
|
||||
// Clear out any records that exist.
|
||||
// Temporary mitigation for #3065.
|
||||
if _, err := eh.Flush(); err != nil {
|
||||
level.Error(eh.logger).Log("err", err, "msg", "failed to flush redis errors")
|
||||
}
|
||||
|
||||
return eh
|
||||
}
|
||||
|
||||
@ -217,6 +224,12 @@ func (h *Handler) handleErrors(ctx context.Context) {
|
||||
}
|
||||
|
||||
func (h *Handler) storeError(ctx context.Context, err error) {
|
||||
// Skip storing errors due to SCAN issues with Redis (see #3065).
|
||||
// if true here because otherwise we get linting errors for unreachable code.
|
||||
if true {
|
||||
return
|
||||
}
|
||||
|
||||
errorHash, errorJson, err := hashAndMarshalError(err)
|
||||
if err != nil {
|
||||
level.Error(h.logger).Log("err", err, "msg", "hashErr failed")
|
||||
|
@ -152,6 +152,9 @@ func TestUnwrapAll(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestErrorHandler(t *testing.T) {
|
||||
// Skipped until error publishing is re-enabled.
|
||||
t.Skip()
|
||||
|
||||
t.Run("works if the error handler is down", func(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel() // cancel immediately
|
||||
@ -288,7 +291,6 @@ func testErrorHandlerCollectsDifferentErrors(t *testing.T, pool fleet.RedisPool,
|
||||
"errorstore\.alwaysNewErrorTwo:%[1]s/errors_test\.go:\d+"
|
||||
\]
|
||||
\}`, wd)), jsonErr)
|
||||
|
||||
} else {
|
||||
assert.Regexp(t, regexp.MustCompile(fmt.Sprintf(`\{
|
||||
"root": \{
|
||||
@ -301,10 +303,12 @@ func testErrorHandlerCollectsDifferentErrors(t *testing.T, pool fleet.RedisPool,
|
||||
\}`, wd)), jsonErr)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestHttpHandler(t *testing.T) {
|
||||
// Skipped until error publishing is re-enabled.
|
||||
t.Skip()
|
||||
|
||||
pool := redistest.SetupRedis(t, false, false, false)
|
||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||
defer cancelFunc()
|
||||
|
Loading…
Reference in New Issue
Block a user