Skip to content

Conversation

@matklad
Copy link
Contributor

@matklad matklad commented Aug 30, 2021

No description provided.

It doesn't make sense for the prime_caches itself send begin/end events
-- the caller knows perfectly fine when they happen!
Let's have only one place where we start delayed ops
There should be only one place where we need to check if we want to
start background activities.
@bjorn3
Copy link
Member

bjorn3 commented Aug 30, 2021

I think you mentioned the wrong issue in the last commit.

@matklad
Copy link
Contributor Author

matklad commented Aug 30, 2021

Seems to work!

It even has this fun effect that, after typing, the indexing restarts at the crate it was finished at -- that's because the coalescing code just rushes thorough already analyzed crates.

I wonder if we can add "is this fresh?" query to salsa, so that we can actually implement this, instead of relying on timing?

bors r+

cc @jonas-schievink

@matklad
Copy link
Contributor Author

matklad commented Aug 30, 2021

bors r-

@bors
Copy link
Contributor

bors bot commented Aug 30, 2021

Canceled.

closes rust-lang#9922

Turned out to be trivial after preliminary refactor.

The intended behavior is that we schedule cache priming once ws become
quiescent (that is, we fully load cargo project), and we continue to
rschedule it until it completes (priming might get cancelled by user
typing into a file).
@matklad
Copy link
Contributor Author

matklad commented Aug 30, 2021

I think you mentioned the wrong issue in the last commit.

Oups, how could I, that was almost #9292!

bors r+

@matklad
Copy link
Contributor Author

matklad commented Aug 30, 2021

I've just realized that bors implements exactly the same concurrency control as we do -- pushes to a branch cancel pending runs, and my git push --force-with-lease && gh pr comment --body 'bors r+' is exactly if cancelled { self.prime_caches_queue.request_op(); } 🤣

@bors
Copy link
Contributor

bors bot commented Aug 30, 2021

@bors bors bot merged commit 5c704f1 into rust-lang:master Aug 30, 2021
@matklad matklad deleted the cp branch August 30, 2021 16:57
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.

2 participants