During development and testing, I open and close the node/wallet a lot, and I get various asserts on exit from time to time. The last one:
Assertion failed: (size_a == sizeof (rai::uint256_union) + sizeof (rai::uint256_union)), function received_frontier, file rai/node/bootstrap.cpp, line 314.
I assume this is because shutting down the node doesn't clean up in-flight requests properly? Quite a few of the asserts could probably be handled more gracefully as runtime errors.
You're seeing this on master or one of the official releases? Can you create a test case for this failure?
@androm3da On master. I'll make a note about the test case, I may be able to look into it a bit later. But I think someone more familiar with the code should evaluate if some of the asserts should be handled more gracefully (intermittent network issues shouldn't crash the node/wallet)
I created a cycle test to repeatedly start the node and shut it down. This assertion happens frequently.
Is the cycle test on a branch?
@androm3da The reason is that the connection is closed while async_read is in flight. This results in a zero-size completion.
I'll cook up a patch.
Thanks @cryptocode
No, @ztbrown the cycle test isn't shared anywhere. It was pretty quick'n dirty but I will make a PR.
@androm3da btw, some tests seem to fail on master (macos), frontier_req.begin for instance (Expected: rai::test_genesis_key.pub)
Thanks for the heads up, I will take a look.
@ztbrown I have not gotten around to cleaning up the cycle test yet but I can share it here:
https://gist.github.com/androm3da/2003a360849cad55e59d1cafbab11e46
Ideally it would have clear pass/fail success criteria and be much less sensitive to interpretation. But I just needed something quick to give a big picture.
Depends on requests, loop it in your shell, e.g. while true; do ./cycle_test.py; done
@androm3da: thanks for this!
Where is requests imported from? I don't see any other modules importing it.
It's an external dependency.
e.g.
virtualenv xrb_test
source xrb_test/bin/activate
pip install requests
./cycle_test.py
Also I think it depends on being able to find ./rai_node in the current dir, and a reference config file -- restart_test_reference.json.
This was very helpful, thanks. I am now having issues with restart_test_reference.json. Is that generated? I don't see it in the repo or anywhere in my build.
Any baseline config.json should work but I uploaded the one that I used to the gist.
I don't know how I missed it. Thank you!
I only just added it.
But now there's a PR to revert the fix. :(
Most helpful comment
I created a cycle test to repeatedly start the node and shut it down. This assertion happens frequently.