Merged
Conversation
Previously, JFactory::Create() would let DoInit() throw without calling JPodioOutput::LagrangianStore(). This leaves the podio::Frame in a bad state where collections are null instead of empty.
This fixes a longstanding source of confusion in the codebase, and paves the way for storing callback exceptions
This separates the concern of "Has Init() run?" (which is sticky across ClearData()) from "Where did the data, if any, come from?", which is not
Previously, it would re-run the excepting code instead.
1e94852 to
97bb307
Compare
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.
This PR redesignes the JFactory state machine, as described in docs/behavior.md, to better enforce a number of guarantees regarding if and when JFactory callbacks get run.
It fixes bugs:
It correctly handles a number of previously unconsidered edge cases
It changes behavior:
ClearData()is called in preparation for the next JEventIt reduces code complexity:
JFactory::CreationStatusis removed completelyJFactory::InitStatusout fromJFactory::Statussimplifies logic elsewhere