Repository navigation
fix(bh): write the minimum before its state_table row - #866
Merged
Merged
Conversation
add_state appends the new row to state_table before it writes states/<n>/minimum.con. A driver killed between the two leaves a row with no geometry. The next pass then fails on the pool draw with FileNotFoundError and on an energy match with OSError, and so does every pass after it. Simulate the kill by raising right after the first table write, and check that the following pass can draw and match. Also check that a state directory left without a row is replaced by the next add_state.
A driver killed after the state_table write and before minimum.con left a row with no geometry, and every later pass aborted on it. EON r2549 writes in this order too. Write states/<n>/ first, each file through io.atomic_write, then add the row. A kill now leaves at worst a directory with no row, and the next new minimum takes that number and overwrites its files. Output of a pass that is not interrupted does not change.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
A driver killed after the
state_tablewrite and beforeminimum.conleft a row with no geometry, and every later pass aborted on it.The pool draw failed with FileNotFoundError and an energy match failed with OSError.
EON r2549 writes in this order too.
add_statenow writesstates/<n>/first, each file throughio.atomic_write, and then adds the row.A kill now leaves at worst a directory with no row, and the next new minimum takes that number and overwrites its files.
Output of a pass that is not interrupted does not change, and no config key or default changes.
tests/test_basin_hop_states.pykills a pass right after the first table write and checks that the next pass can draw and match.It also checks that a state directory left without a row is replaced by the next
add_state.The first two tests fail on develop and pass here.