fix: Close the final initializer on exhaustion; document the source manager contract#304
Merged
Merged
Conversation
d7b99a0 to
f0e7b5c
Compare
kinyoklion
commented
Jun 12, 2026
| /// activate. The active source keeps running until the next | ||
| /// activation closes it. | ||
| void engageFdv1Fallback() { | ||
| if (!hasFdv1FallbackConfigured) { |
Member
Author
There was a problem hiding this comment.
In practice we may not make this possible.
joker23
approved these changes
Jun 12, 2026
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.
What this changes
Two small behavior hardenings and an explicit statement of the source manager's API contract.
engageFdv1Fallback()is a no-op when no FDv1 fallback slot is configured. Blocking every slot without unblocking a fallback would leave nothing to activate. The orchestration layer checks before engaging; the guard makes the operation safe regardless of the caller.hasFdv1FallbackConfiguredreplaceshasFdv1Fallbackto make clear it reports configuration, not engagement state.The documented contract
The class docs now state the assumptions the manager operates under, so they are visible at the API surface rather than implicit in the call sites:
closecloses whatever remains.nextAvailableSynchronizer/recreateCurrentSynchronizer) until the next cursor mutation (resetSynchronizerIndex/engageFdv1Fallback), the cursor identifies the running synchronizer's slot —isPrimarySynchronizerandblockCurrentSynchronizerread it and are only meaningful inside that window. After mutating the cursor, a new synchronizer must be activated before consulting either. The driver satisfies this by construction: both reads happen strictly between an activation and the run's outcome being decided, and cursor mutations happen only after the outcome is decided.Testing
New tests pin the exhaustion close (a terminal null leaves no source running) and the fallback-engagement guard (engaging with no configured FDv1 slot leaves the slot list untouched). Full package suite passes.
SDK-2186