Skip to content

Buffer envelopes after resolving broken project states #1787

Closed

Description

@jan-auer

If the upstream responds with broken states, Relay attempts to reuse old caches as long as possible. However, if there is no cache, Relay immediately drops envelopes. Our stability SLO suggests that we should buffer envelopes instead until they timeout.

To achieve this behavior, we will have to:

  • Leave envelopes in the queue when states are invalid
  • Expire queued envelopes when a timeout has been reached
  • Check whether there should be a timeout on the envelopes or rather on the project state

Created from #1767 (comment)

Activity

  1. added
    bug
    on Jan 27, 2023
  2. jan-auer commented on Jan 27, 2023

    @jan-auer
    MemberAuthor

    One an invalid state has been resolved, it's passed back into the project cache here, which triggers a flush of all queues:

    // Flush all queued `ValidateEnvelope` messages
    while let Some((envelope, context)) = self.pending_validations.pop_front() {
    self.flush_validation(envelope, context, state.clone());
    }
    // Flush all queued `AddSamplingState` messages
    while let Some(message) = self.pending_sampling.pop_front() {
    self.flush_sampling(message);
    }

    This internally invokes check_envelope, which eventually rejects the envelope:

    // if we recorded an invalid project state response from the upstream (i.e. parsing
    // failed), discard the event with a state reason.
    if self.invalid() {
    return Err(DiscardReason::ProjectState);
    }

  3. added this to the Maintenance milestone on Jan 30, 2023
  4. added
    filler
    on Feb 3, 2023
  5. self-assigned this
    on Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfiller

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions