Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Fixing behavior where we bail on all batches if one fails#1019

Open
andresgalindo-stripe wants to merge 2 commits into
masterfrom
andresgalindo/dont-stop-all-batching-if-one-batch-fails
Open

Fixing behavior where we bail on all batches if one fails#1019
andresgalindo-stripe wants to merge 2 commits into
masterfrom
andresgalindo/dont-stop-all-batching-if-one-batch-fails

Conversation

@andresgalindo-stripe

Copy link
Copy Markdown
Contributor

Summary

No longer erring out if one batch fails

Motivation

We want as many metrics to try and get written, errors may be related to things like writing duplicate time series which shouldn't stop the entire loop.

Test plan

Rollout/monitoring/revert plan

@andrewa-stripe andrewa-stripe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor changes. Understand the change now and old comments were not relevant.

Comment thread sinks/cortex/cortex.go
}

var _ sinks.MetricSink = (*CortexMetricSink)(nil)
var DoIfNotDoneError = errors.New("context finished before completing metrics flush")

@andrewa-stripe andrewa-stripe Dec 18, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New also records the stack trace at the point it was called

errors.New should not be cached for usages

If error checking is necessary, we should introduce an error type and use errors.Is

Comment thread sinks/cortex/cortex.go
s.logger.Error(err)
droppedMetrics += len(metrics) - flushedMetrics
// Any other type of error will happen inside of doIfNotDone
// so we only need ot handle context cancellations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// so we only need ot handle context cancellations
// so we only need to handle context cancellations

@andrewa-stripe

andrewa-stripe commented Jan 22, 2023

Copy link
Copy Markdown
Contributor

#1022 does the ?same?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants