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

scheduler: simplify build status handling #10548

Closed
wants to merge 4 commits into from

Conversation

pmwhite
Copy link
Collaborator

@pmwhite pmwhite commented May 18, 2024

Based off #10518

This is an alternative to #10519, based on some discussion in that PR. This one keeps the build status intact, but merges Standing_by and Restarting_build into a single case. I recommend reading the diff commit-by-commit.

if Fiber.Cancel.fired cancellation
then []
else (
t.handler t.config Build_interrupted;
Copy link
Member

Choose a reason for hiding this comment

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

Before, we'd call this callback unconditionally. Is there a change of behavior here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Before, it was impossible to hit this case twice in the same build because of the t.status <- Not_building line above. But without that line, we can hit this case multiple times, and we only want to sent the Build_interrupted notification on the first interruption (instead of sending it on every subsequent interruption).

@pmwhite pmwhite force-pushed the simplify-build-status-handling branch from ad19bb9 to b29d354 Compare May 27, 2024 20:39
Philip White added 4 commits May 27, 2024 16:41
Signed-Off-By: Philip White <code@trailingwhite.space>
Now that we use Memo.Invalidation.is_empty an indicator that the build
should immediately restart, we no longer need a separate state for
restarting a build.

Signed-Off-By: Philip White <code@trailingwhite.space>
This we count the period after cancellation but before the fiber is
completed as part of the build, rather than as Not_building. It also
makes it more obvious where state transitions happen.

Signed-Off-By: Philip White <code@trailingwhite.space>
Instead of storing the same cancellation token in two places, we always
use it from the status field, which allows us to enforce that it is only
accessed when there is a build going on.

Signed-Off-By: Philip White <code@trailingwhite.space>
@pmwhite pmwhite force-pushed the simplify-build-status-handling branch from b29d354 to b1f2ddd Compare May 27, 2024 20:41
@pmwhite
Copy link
Collaborator Author

pmwhite commented May 27, 2024

I just ran this PR against our internal test suite and hit the following bug: In passive watch mode, if we cancel a build at about the same time as a file changes, then our explicit cancellation will be ignored because it look like the build was cancelled in response to a memo invalidation.

I'm going to close this PR for now because I'm no longer sure this is getting me any closer to my goal.

@pmwhite pmwhite closed this May 27, 2024
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.

None yet

2 participants