Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(spooler): Remove use of legacy project cache #4419

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

iambriccardo
Copy link
Member

@iambriccardo iambriccardo commented Dec 23, 2024

This PR removes the old legacy project cache and implements the forwarding logic directly in the spooler. The new logic works as follows:

  • We still optimistically assume that a new project key pair is ready. (This assumption is intentionally made without the sync check to simplify the buffering code)
  • When peeking, if the key pair is ready, we synchronously load the project states. If at least one state is pending, the pop will not occur, and the project configs will be scheduled for fetching. If both states are available, the envelope will either be forwarded to the processor or dropped, depending on the state.

Follow-up work could include investigating how to reintroduce a bounded buffer between the buffer and the processor to prevent unspooling a large number of envelopes at once, which would accumulate in the processor queue. This option is not strictly necessary due to our memory threshold, which halts unspooling, but it may still be worth exploring.

Closes: #4335

pub own_key: ProjectKey,
pub sampling_key: ProjectKey,
own_key: ProjectKey,
sampling_key: Option<ProjectKey>,
Copy link
Member Author

@iambriccardo iambriccardo Dec 23, 2024

Choose a reason for hiding this comment

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

I decided that I would prefer to encode in the pair the lack of sampling key and rather expose different methods for making it behave like before, where they were both set and the fallback of sampling_key was own_key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Directly check project availability when creating an envelope stack
1 participant