Skip to content

Remove priority::flush and rename node::block_confirm to node::start_election#4276

Merged
clemahieu merged 3 commits intonanocurrency:developfrom
clemahieu:remove_priority_flush
Sep 5, 2023
Merged

Remove priority::flush and rename node::block_confirm to node::start_election#4276
clemahieu merged 3 commits intonanocurrency:developfrom
clemahieu:remove_priority_flush

Conversation

@clemahieu
Copy link
Copy Markdown
Contributor

This PR contains 3 commits that:

  • Removes blocking nano::test::confirm functions which have functionality superceded by nano::test::start_elections which polls a nano::system rather than using a thread wait
  • Renames nano::block_confirm to node::start_election. This adresses a TODO item to better name this function and make it not block
  • Removes priority::flush function as flush functions are being removed from the codebase.

@clemahieu clemahieu requested a review from pwojcikdev September 4, 2023 14:45
pwojcikdev
pwojcikdev previously approved these changes Sep 4, 2023
Copy link
Copy Markdown
Contributor

@pwojcikdev pwojcikdev left a comment

Choose a reason for hiding this comment

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

The change doesn't look bad, but I don't think the usage and implementation of nano::test::start_elections is correct, since it uses a release_assert(..) internally. That will just abort the whole testsuite run on the first error. The correct way would be to have nano::test::start_elections return a boolean and call it with ASSERT_TRUE(nano::test::start_elections(..)) similar to the way it was done so far.

…nano::test::start_elections which uses a nano::system to poll.

This function both started an election and returned whether the block was confirmed. This is an asynchronous operation which required thread blocking. Instead, use start_elections which has polling semantics.
This is unwinding some of the blocking operations on the node class and addresses a TODO item to improve this function name.
Fixes election.construction test where election might become active/inactive before it can be polled in the test. Removes election_scheduler.flush_vacancy which only tested the flush function.
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.

2 participants