How to Handle le_avdata_PushRecord Handler Failure

What should be done when the le_avdata_PushRecord() handler returns LE_AVDATA_PUSH_FAILED?

Should I retry the push, delete the resource loosing the data and then start again?

This is related to https://forum.legato.io/t/le-avdata-pushrecord-handler-failure/4440

Thanks

Hey Darren,

Have you looked closely at any of the AirVantage or LWM2M code (see https://github.com/legatoproject/legato-Service-AirVantageConnector and https://github.com/legatoproject/lwm2mCore)? I believe your error originates from line #99 in avcDaemon/push.c (see https://gist.github.com/nvandoorn/b4a2d1df51699e36eb2e64863daca00e#file-avc-service-c-L23). Looks like this error is reported when an ack is missed. Based on this quick analysis I would either a) re-send the data or b) verify that avcService will retry these failed pushes.

Hope this is helpful,

Happy hacking

@nvd

Hey Nick,

Thanks for your thoughts and the links. I was already looking at some of those files especially avcDaemon/push.c.

Couple of things I have found so far that lead me to scratch my head:

  1. Once a record has successfully pushed or queued then the record is reset. See avcDaemon/timeseriesData.c line #1597
  2. It doesn’t matter if a push handler is called with a status of LE_AVDATA_PUSH_SUCCESS or LE_AVDATA_PUSH_FAILED the item on the push linked list is removed from the list and the data is lost at that point. See avcDaemon/push.c lines #105 to #122.

Perhaps you can review and see if you agree with my assessment.

Thoughts?

Hey Darren,

That does seem accurate based on the code (though it may be good to review with the authors since it’s a complex project with lots of dependencies). If that analysis is correct, perhaps the code for avcService should be changed to remove data from the linked list after we receive the ACK.

Alternatively you could maintain your own list/queue in another app and only delete them after receiving LE_AVDATA_PUSH_SUCCESS. This seems like a ton of abstraction though, so it’s probably better to just submit a patch to avcService.

Sierra has identified this as a problem and the issue is being worked on internally.