Skip to content

Conversation

@DustinCampbell
Copy link
Member

Fixes #10306

This change takes a different approach than #10308 and #10330. The problem that all of these are trying to fix is to ensure that "add" or "change" events for configuration file for an unknown project result in a project add at the correct time. The timing details are in #10306.

The timing problem occurs because the project should be added before any other enqueued resets or updates run. However, recent changes to use an AsyncBatchingWorkQueue made all work happen in the same batch, including work to add missing projects. This change pulls project adds out of the work queue and just adds them immediately. This takes advantage of the fact that the ProjectSnapshotManager handles operations in a queue, so the project add will happen before any resets or updates. This is effectively how ProjectConfigurationChangeSynchronizer worked before, but this change keeps the batching work queue for project resets and updates.

In particular, the dictionary to map configuration file paths to project keys isn't needed. Currently, the configuration file is in the project's intermediate output path, which *is* the project key.
@DustinCampbell DustinCampbell requested a review from a team as a code owner May 1, 2024 18:39
@jaredpar
Copy link
Member

jaredpar commented May 1, 2024

At the next razor design meeting I think we should all take a turn trying to pronounce YAPCSSF. :)

davidwengier added a commit that referenced this pull request May 2, 2024
…#10335)

Fixes #10306

This change takes a different approach than
#10308 and
#10330 and
#10332 because life was meant to be
interesting.

The original problem we were trying to solve is that when a Reset then
Add came in, we would migrate all of the documents out of the project,
then migrate them all back in again. The various solutions in the other
PRs you can read about at your leisure, this one takes a rather simple
approach:

1. Ignore everything but the most recent update for a specific project
2. If we need to update a project, but it doesn't exist, add it

In the long run we should remove `IRazorProjectService.AddProjectAsync`
entirely, and rename `IRazorProjectService.UpdateProjectAsync` to
`ResetProjectAsync`, but doing that now would just conflict with other
open PRs.
@DustinCampbell
Copy link
Member Author

Closing this PR since @davidwengier won

@DustinCampbell DustinCampbell deleted the try-again branch June 14, 2024 08:36
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.

ProjectConfigurationStateSynchronizer is doing too much work

2 participants