What became of one delivery attempt. A bare true/false could not tell "the server will never
take this payload" apart from "try again later", so a batch a plan or a validation rule refused
was re-sent at every flush for as long as the node lived. Ported from gems/forge_ops_tracker's
delivery_status.rb.
:deliveredis any 2xx.:rejectedis a 4xx other than 408 and 429: sending the same payload again can only fail the same way.:failedis a network error, a timeout, a 5xx, a 408 or a 429: worth another attempt later.
ForgeOpsTracker.Client's deliver* functions still answer a boolean (true only for
:delivered); its attempt_* functions answer the status itself.
Summary
Functions
After this many flushes in a row that failed for now, a batch is dropped rather than kept for yet another attempt, so an outage can never pin the same data in memory for the life of the node.
Decides whether the batch a flush just sent is done with, given the status of the attempt and how
many flushes in a row had failed before it. Returns {:release, nil} for a delivered batch,
{:release, why} for one to drop (why is what to log), and {:keep, failed_flushes} for one to
hold for the next flush, with the new count.
Types
Functions
@spec max_failed_flushes() :: pos_integer()
After this many flushes in a row that failed for now, a batch is dropped rather than kept for yet another attempt, so an outage can never pin the same data in memory for the life of the node.
@spec settle(t(), non_neg_integer()) :: {:release, String.t() | nil} | {:keep, pos_integer()}
Decides whether the batch a flush just sent is done with, given the status of the attempt and how
many flushes in a row had failed before it. Returns {:release, nil} for a delivered batch,
{:release, why} for one to drop (why is what to log), and {:keep, failed_flushes} for one to
hold for the next flush, with the new count.