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

feat(backfill): add #5

Merged
merged 6 commits into from
Jul 23, 2024
Merged

feat(backfill): add #5

merged 6 commits into from
Jul 23, 2024

Conversation

shekhirin
Copy link
Contributor

@shekhirin shekhirin commented Jul 18, 2024

image

@shekhirin shekhirin added the example New example label Jul 18, 2024
@shekhirin shekhirin requested a review from mattsse July 18, 2024 18:31
@shekhirin shekhirin marked this pull request as ready for review July 18, 2024 18:32
Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

this is pretty cool!

one suggestion

Comment on lines 47 to 48
Some(range) = self.backfill_rx.recv() => {
let _ = self.backfill(range).await.inspect_err(|err| error!(%err, "Backfill error occurred"));
Copy link
Contributor

Choose a reason for hiding this comment

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

this will effectively wait until the range is done, and could starve notification processing, we should just spawn this, ideally we also spawn and use some semaphor as guard so we limit the concurrent backfill requests

Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

last nit

Comment on lines +107 to +111
let permit = self
.backfill_semaphore
.clone()
.try_acquire_owned()
.map_err(|err| eyre::eyre!("concurrent backfills limit reached: {err:?}"))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

this needs to be moved into spawn and await acquire

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it will just block the RPC request, right? I explicitly return an error if we ran out of permits.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see

@gakonst
Copy link
Member

gakonst commented Jul 23, 2024

we'll also want a stop backfill command i think by job id, and returning a job id on creation of a backfill job

@shekhirin
Copy link
Contributor Author

we'll also want a stop backfill command i think by job id, and returning a job id on creation of a backfill job

yep, in a separate PR

@shekhirin shekhirin merged commit 9f9b904 into main Jul 23, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example New example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants