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

ensure deterministic component iteration order #1472

Merged
merged 1 commit into from
May 11, 2023

Conversation

dicej
Copy link
Contributor

@dicej dicej commented May 10, 2023

This regressed due to changes I made to TriggerAppEngine::new to support components. I used a HashMap without realizing the iteration order of triggers (and their configs) matters.

Fixes #1469

This regressed due to changes I made to `TriggerAppEngine::new` to
support components.  I used a `HashMap` without realizing the
iteration order of triggers (and their configs) matters.

Fixes fermyon#1469

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej requested a review from itowlson May 10, 2023 21:43
@dicej
Copy link
Contributor Author

dicej commented May 10, 2023

Note that I considered writing a test for this, but the non-determinism makes it tricky. I'd prefer to avoid tests which sometimes pass and sometimes fail, and I'm not sure how to avoid that here.

Copy link
Contributor

@itowlson itowlson left a comment

Choose a reason for hiding this comment

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

Thanks for tracking this down and for the super quick fix!

@itowlson
Copy link
Contributor

Re testing, it could be done probabilistically - use a manifest with (say) 5 components in it, check the print order matches the manifest order, repeat 20 times, and that should get it to a "GUID collision/cosmic ray bitflip" risk of being wrong. But given the very small impact of ordering issues, I'm not sure it's worth it!

@dicej dicej merged commit 0ed8643 into fermyon:main May 11, 2023
@dicej dicej deleted the trigger-iteration-order branch May 11, 2023 13:58
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.

Print HTTP routes in stable order
2 participants