Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Fixed regression to 'File not ready yet' state #120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

colinmcintosh
Copy link

This PR fixes an issue that causes octorpki to return the 'File not ready yet' state after previously achieving a stable state.

There are two functions that lead me to believe reverting to the 'File not ready yet' state is not the intended behavior of octorpki. In both ServeROAs and ServeHealth the code checks for s.Stable and s.HasPreviousStable, seemingly to continue serving ROAs if the state was once stable but isn't currently. The only place s.HasPreviousStable is set is immediately after s.Stable is set on octorpki.go#L1254 so whenever s.Stable reverts to false after s.MainReduce() so will s.HasPreviousStable. Both s.Stable and s.HasPreviousStable being false will cause octorpki to revert to a state where no ROAs are served and instead a message is returned: 'File not ready yet'. s.Stable is also set after the validation interval expires but that will result in s.HasPreviousStable only being true for a single additional iteration, after which it may revert to false (based on the result of s.MainReduce()).

The fix adds check to only set s.HasPreviousStable when s.Stable is true.

While I was making this change I also noticed that s.HasPreviousStable isn't set after MaxIterations is reached which similarly would result in the ROA list switching back and forth between available and 'File not ready yet'. I updated that to also set s.HasPreviousStable.

Happy to make any adjustments to this PR as needed. Please let me know if I'm misunderstanding the intended use of s.HasPreviousStable at all. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant