-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
uORB: fix: When multiple publishers publish data to the same node, any publisher cancels the publication and the node becomes invalid #16084
base: main
Are you sure you want to change the base?
Conversation
964df29
to
5b107ca
Compare
Are you going to remove the hack in the destructor as well? PX4-Autopilot/src/modules/uORB/Publication.hpp Lines 85 to 89 in ecb462f
|
Adding the number of publishers to uorb status/top might also be enlightening. update: 1s, num topics: 65
TOPIC NAME INST #SUB RATE #Q SIZE
actuator_armed 0 8 1 1 24
actuator_controls_0 0 6 796 1 48
actuator_outputs 0 3 50 1 80
battery_status 0 8 2 1 120
commander_state 0 1 1 1 16
cpuload 0 4 2 1 16
multirotor_motor_limits 0 2 50 1 16
px4io_status 0 1 1 1 128
rate_ctrl_status 0 1 796 1 24
safety 0 2 1 1 16
sensor_accel 0 4 796 8 48
sensor_combined 0 2 199 1 48
sensor_gyro 0 4 796 8 40
sensor_preflight_mag 0 1 50 1 16
sensors_status_imu 0 1 199 1 72
system_power 0 2 100 1 24
telemetry_status 0 2 1 1 56
telemetry_status 1 2 1 1 56
vehicle_acceleration 0 2 199 1 32
vehicle_angular_acceleration 0 1 796 1 32
vehicle_angular_velocity 0 6 796 1 32
vehicle_control_mode 0 14 1 1 32
vehicle_imu 0 5 199 1 56
vehicle_imu_status 0 4 10 1 88
vehicle_land_detected 0 7 1 1 24
vehicle_status 0 22 1 1 56
vehicle_status_flags 0 1 1 1 40
|
Yes, it will be done in another pull request soon. |
5b107ca
to
be57bce
Compare
Done. |
This is really a complicated question.
In this way, If we can do this, |
We're actually pretty close to not needing the underlying file descriptors at all with the vast majority of subscriptions in the system using |
Can you rebase on master to get the uORB test changes? You could then uncomment line 830 so we can ensure the failure discussed in #16093 is resolved. PX4-Autopilot/src/modules/uORB/uORB_tests/uORBTest_UnitTest.cpp Lines 830 to 831 in ba5ef28
|
c0ddc04
to
13d26c0
Compare
I thought of the solution. Unified increase the number of publishers in _device_master->advertise(). |
37b882a
to
6069066
Compare
In Another advantage of this is that the creation is performed only when it is determined that the node needs to be created, instead of using |
Two months ago, I was busy with other things. I reviewed my commit and made some changes. |
Please review this pull request. @bkueng |
Yes I will |
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.
The code looks correct, I remarked a couple of details that need to be updated.
6327d01
to
5bc66d4
Compare
Thank you. It has been changed and rebase to the latest master branch. |
Thanks. A remaining problem is that the pub counter keeps increasing for some topics, like CI failure is unrelated:
|
@bkueng what is needed to get this PR in? |
See my latest comment. A more minimal change would be to clamp the counter to avoid overflow. |
I think there may not be a situation where |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
…y publisher cancels the publication and the node becomes invalid
5bc66d4
to
c74660d
Compare
Any progress here? I agree that |
Sorry, I've been busy with my other work. |
When multiple publishers use
DeviceNode
instance 0 to publish data inuORB
, any node cancels publishing, which will cause the node to be marked as unadvertised, and the data cannot be obtained by subscribers.This fix counts the number of publishers to determine whether there are still publishers.
To this end, a test case
uORBTest::UnitTest::test_single_unadvertise()
has been written to test this situation.Note: The mismatch between
orb_advertise
andorb_unadvertise
may cause errors. But if you use the C++ interface, this problem will not exist.This fix is inspired by #16012 (comment)