Dx/bring 30895de 08ada7a - #179
Merged
Merged
Conversation
This PR tries to improve a little the shutdown by properly waiting critical tasks with JoinHandles and cancelling infinite loops (locking resourses) with a CancellationToken. It also add 2 new parameters indexer.clickhouse.send-timeout-ms/indexer.clickhouse.end-timeout-ms to configure clickhouse timeouts. --------- Co-authored-by: Jonas Bostoen <jonasbostoen@fastmail.com>
This PR adds a new parameter `disk_max_size_to_accept_user_rpc_mb`. When the user RPC detects that the local DB backup size exceeds `disk_max_size_to_accept_user_rpc_mb`, it starts rejecting flow. This allows us to configure it to guarantee we never lose archive flow. It also adds a metric for `disk_max_size_to_accept_user_rpc_mb `to allow adding alarms easily. --------- Co-authored-by: Jonas Bostoen <jonasbostoen@fastmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ZanCorDX
requested review from
efbig,
mempirate,
metachris,
plroman and
thedevbirb
as code owners
March 11, 2026 16:56
fsodre
approved these changes
Mar 11, 2026
| pub async fn listen(mut self, cancellation_token: CancellationToken) { | ||
| loop { | ||
| tokio::select! { | ||
| Some(req) = self.reply_socket.next() => { |
Collaborator
There was a problem hiding this comment.
Don't we need to treat None here? What happens if the socket drops?
| local_builder_url: builder_url, | ||
| builder_ready_endpoint, | ||
| indexer_handle, | ||
| disk_max_size_to_accept_user_rpc: args.disk_max_size_to_accept_user_rpc_mb * 1024 * 1024, |
Collaborator
There was a problem hiding this comment.
Should we use saturating_mul() here too?
Collaborator
Author
There was a problem hiding this comment.
It will never reach that, but you are right, I'll change it.
| loop { | ||
| tokio::time::sleep(Duration::from_secs(60)).await; | ||
| ingress.maintenance().await; | ||
| info!("starting state maintenance!!"); |
Collaborator
There was a problem hiding this comment.
nit: shouldn't we show this log only when actually doing maintenance?
Collaborator
Author
There was a problem hiding this comment.
I'll remove that, we also trace inside the func
| pub const SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(20); | ||
|
|
||
| /// Consider move this to rbuilder-utils. | ||
| /// Waits for critical_tasks to finish by themselves up to grateful_timeout. |
Collaborator
There was a problem hiding this comment.
nit: Should it be "graceful_timeout"?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#174
git cherry-pick 30895de
#175
git cherry-pick 08ada7a