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
Fix execution halt when reloading blocks #924
Conversation
…ution and halt the execution as a result
Codecov Report
@@ Coverage Diff @@
## master #924 +/- ##
==========================================
+ Coverage 54.84% 55.05% +0.21%
==========================================
Files 277 277
Lines 18322 18324 +2
==========================================
+ Hits 10048 10089 +41
+ Misses 6925 6879 -46
- Partials 1349 1356 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix 👍
// we receive H <- G, then the queues will become: | ||
// A <- B <- C | ||
// ^- D <- E | ||
// G | ||
func enqueue(blockify queue.Blockify, queues *stdmap.QueuesBackdata) (*queue.Queue, bool) { | ||
func enqueue(blockify queue.Blockify, queues *stdmap.QueuesBackdata) (*queue.Queue, bool, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to explain the two bool value. I think the first is whether the block is a new block
, the second is whether the block is the head of a queue
.
queue, false, false
, means the block is a duplication
queue, true, true
, means it's a block that is the head of a queue
queue, true, false
means it's a block that is not the head of a queue, but extending a existing queue.`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, definitely feel like once we get to two bools, might be more clear to either change to a "queue status" enum of some sort, or maybe a struct with two bool fields, for improved clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think enum would help, as there are two decision to be made - first value (if fresh block/or not duplicate) let you bail out fast, second decides if execution can start. Representing this login with enum would seems more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres some clean up that @zhangchiqing mentioned that i would definitely like to see, but the functionality makes sense to me
// we receive H <- G, then the queues will become: | ||
// A <- B <- C | ||
// ^- D <- E | ||
// G | ||
func enqueue(blockify queue.Blockify, queues *stdmap.QueuesBackdata) (*queue.Queue, bool) { | ||
func enqueue(blockify queue.Blockify, queues *stdmap.QueuesBackdata) (*queue.Queue, bool, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, definitely feel like once we get to two bools, might be more clear to either change to a "queue status" enum of some sort, or maybe a struct with two bool fields, for improved clarity.
Add warn for impossible unexecutable highest block Clarified enqueue return values
No description provided.