Handle QoS2 messages when the library loses state - store state in NVM

Aperta
#271 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@guclumhg ci sta già lavorando.

Dal 10/7/2026.

  • #379 di @guclumhg — aperta

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
15/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

Start by reading the QoS2 receive flow and how MQTT_ProcessLoop handles MQTT_PACKET_TYPE_PUBREL when outgoingPublishRecords is empty. The issue names no files or tests, so locate the relevant code and tests in the repository. Done means the client handles a reboot between receiving a QoS2 message and receiving PUBREL without returning MQTTBadResponse; the linked open pull request indicates work is already underway.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement help wanted

It is a very narow corner case but stil it breaks the client and renders it unusable.

  1. coreMQTT client is running on an embedded device, it subscribed to a topic with QoS2.
  2. The issue happens when a message is received and then the device reboots (for unrelated to coreMQTT reasons).
  3. When it boots again and re-connects to the broker it immidiately receives MQTT_PACKET_TYPE_PUBREL but since the device was rebooted the library has no knowleadge of the packet it received before, outgoingPublishRecords is empty and MQTT_ProcessLoop returns MQTTBadResponse.

Q: How would you suggest to handle a situation like this? There are no public functions in the library to get the failed packet id and to get access to outgoingPublishRecords structure that one could simply inject a record with id and MQTT_PACKET_TYPE_PUBCOMP type to let go that record. In the corner case like this I guess it's ok to lose the record since not much you can do if device reboots.

Lingua principale
C
Stelle
239
Fork
131
Merge medio
6h 51m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/coreMQTT

Tutte le issue di FreeRTOS/coreMQTT

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.