You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, the previous version in which this bug was not present was: ....
Description and Minimal Reproduction [REQUIRED]
We have seen some instances where an uploaded device (e.g. res/devices/xxx.yaml) gets created and exists in core-metadata, but is not in the service's devmap, so resource operations return 404 until the service is restarted.
This seems to be a race in service.c startConfigured() where we call edgex_bus_register_handler() to get the callback to edgex_callback_add_devices(), which is the function that actually adds to the devmap. Then we immediately call edgex_device_devices_upload(), but in bus-mqtt.c we are calling an async subscribe function and it has apparently not finished, so we miss the callback because core-metadata posts the system event before our subscription has taken effect.
🔥 Exception or Error
🌍 Your Environment
Deployment Environment: Yocto, MQTT message bus
EdgeX Version [REQUIRED]: Post-3.1 main branch
Anything else relevant?
Posting a PR with the fix that worked for us - have edgex_bus_mqtt_subscribe() not return until that async subscribe is complete, by calling MQTTAsync_waitForCompletion().
It has been getting lots of exercise in our automated system test framework with no apparent ill effects,
The text was updated successfully, but these errors were encountered:
…exfoundry#516)
MQTTAsync_subscribe() is async. There are some places e.g. startConfigured()
where we expect the subscription to be in effect right after this call.
So wait for completion before returning.
Signed-off-by: Corey Mutter <[email protected]>
…exfoundry#516)
MQTTAsync_subscribe() is async. There are some places e.g. startConfigured()
where we expect the subscription to be in effect right after this call.
So wait for completion before returning.
Fixes: edgexfoundry#516
Signed-off-by: Corey Mutter <[email protected]>
…exfoundry#516)
MQTTAsync_subscribe() is async. There are some places e.g. startConfigured()
where we expect the subscription to be in effect right after this call.
So wait for completion before returning.
Fixes: edgexfoundry#516
Signed-off-by: Corey Mutter <[email protected]>
🐞 Bug Report
Affected Services [REQUIRED]
The issue is located in: device-sdk-cIs this a regression?
Yes, the previous version in which this bug was not present was: ....Description and Minimal Reproduction [REQUIRED]
We have seen some instances where an uploaded device (e.g. res/devices/xxx.yaml) gets created and exists in core-metadata, but is not in the service's devmap, so resource operations return 404 until the service is restarted.
This seems to be a race in service.c startConfigured() where we call edgex_bus_register_handler() to get the callback to edgex_callback_add_devices(), which is the function that actually adds to the devmap. Then we immediately call edgex_device_devices_upload(), but in bus-mqtt.c we are calling an async subscribe function and it has apparently not finished, so we miss the callback because core-metadata posts the system event before our subscription has taken effect.
🔥 Exception or Error
🌍 Your Environment
Deployment Environment: Yocto, MQTT message bus
EdgeX Version [REQUIRED]: Post-3.1 main branch
Anything else relevant?
Posting a PR with the fix that worked for us - have edgex_bus_mqtt_subscribe() not return until that async subscribe is complete, by calling MQTTAsync_waitForCompletion().
It has been getting lots of exercise in our automated system test framework with no apparent ill effects,
The text was updated successfully, but these errors were encountered: