-
Notifications
You must be signed in to change notification settings - Fork 93
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
Conversation
pub own_key: ProjectKey, | ||
pub sampling_key: ProjectKey, | ||
own_key: ProjectKey, | ||
sampling_key: Option<ProjectKey>, |
There was a problem hiding this comment.
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
.
…try/relay into riccardo/ref/remove-project-check
pub fn own_key(&self) -> ProjectKey { | ||
self.own_key | ||
} | ||
|
||
pub fn sampling_key(&self) -> ProjectKey { | ||
self.sampling_key | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any downside of just keeping the fields public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, can revert.
ProjectState::Pending => { | ||
unreachable!("The own project should not be pending after pop"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we merge this with the above check for pending, this panic shouldn't be necessary
pub fn own_key(&self) -> ProjectKey { | ||
self.own_key | ||
} | ||
|
||
pub fn sampling_key(&self) -> ProjectKey { | ||
self.sampling_key | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
This PR removes the old legacy project cache and implements the forwarding logic directly in the spooler. The new logic works as follows:
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