-
Notifications
You must be signed in to change notification settings - Fork 107
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
System test broker with crash #754
Conversation
daf0c61
to
ae6a066
Compare
I fixed the issue. I was working on shared subscriptions. See #752 After I fixed the assertion fail, I experienced another issues.
Also I fixed them. |
1c31f90 |
It seems that the assertion fail still happens on CI I couldn't reproduce it on my local environment, so far. Need more investigation... |
I successfully reproduced the assertion fail on my local environment. |
It can avoid event handler call after close. It requires a little big stack. If the packet contains N properties, then call stack complexity is O(N). N times recursive call of property parsing function. I'm not sure it is acceptable.
4e4ab20
to
f8395a4
Compare
I removed the post() on parse. Design choice:Removing post
Remain post and check the connection status in the post handler
Anyway, please check the PR on your environemnt. |
Codecov Report
@@ Coverage Diff @@
## master #754 +/- ##
==========================================
- Coverage 85.52% 85.50% -0.02%
==========================================
Files 60 60
Lines 8557 8521 -36
==========================================
- Hits 7318 7286 -32
+ Misses 1239 1235 -4 |
CI reported expected results. |
Yes, it is stable now. I guess my test for the broker does not properly shutdown. |
Thank you for checking. I will fix the test too. |
I still get an assertion with the python script: The C++ test runs fine now. But I guess there is still some race condition somewhere |
Renamed test.
I fixed and renamed the test. Now, we can do test again and again until the test fails using the following command. while ./st_issue_749; do done Note: I'm using zsh. I'm not sure I can do the same thing on the gdb. I want to do that. But I figured out what is happening at the failure case. I inserted the following debug print code just after mqtt_cpp/include/mqtt/endpoint.hpp Line 6504 in cf6e816
std::cout << connected_ << std::endl; In success case, it outputs 1 (true), but failure case, it outputs 0 (false). |
Well, it is difficult to validate all the different cases in which the race condition occurs. You can not really create a test, because it depends on the timing of events. Hopefully it fails when running multiple times. |
Even if async_read()'s error_code is not error, the connection has already been disconnected then regard to error.
I think I may have another test case: terminate called after throwing an instance of 'mqtt::packet_id_exhausted_error' |
I added the commit to fix the issue. |
i will try also |
It seems that a different topic. Please create new issue. |
In order to make a subtle timing, my proprietary broker has mocking mechanism. And tons of tests. mqtt_cpp broker is originally test_broker. And it has delay mechanism for tests. I think that adding more delay mechanism is easier way to make subtle timing. It is low priority for me. I need to implement a lot of functionalities. |
Yes, it seems stable now, with python script also. I will do some more testing |
It is for test. st_broker is unfinished. It is expected.