coreMQTT: No ack found for packet id #

I am using coreMQTT v2.1.1 and coreMQTT-Agent V1.2.
After a running for a long time, these messages accumulate:

I (146451442) network: Attempting to connect to MQTT
I (146450881) hmqtt: Connected to MQTT.
I (146450882) hmqtt: Session present.
E (146450882) coreMQTT: No ack found for packet id 15788.
E (146450886) coreMQTT: No ack found for packet id 16425.
E (146450893) coreMQTT: No ack found for packet id 60272.
E (146450899) coreMQTT: No ack found for packet id 26707.
E (146450905) coreMQTT: No ack found for packet id 28396.
E (146450912) coreMQTT: No ack found for packet id 49384.
E (146450918) coreMQTT: No ack found for packet id 49987.
E (146450925) coreMQTT: No ack found for packet id 62338.
E (146450931) coreMQTT: No ack found for packet id 43880.
E (146450938) coreMQTT: No ack found for packet id 34763.
I (146450944) hmqtt: Session resumed.
I (146451992) network: ConnectToMQTT succeeded
I (146450954) hmqtt: Waiting for network to be ready...
I (146450960) network: Subscribing to MQTT topics ...

This only happens on some devices, some of the time.
What is the cause of this issue? Is it due to maintaining the session across reconnects?
I am worried that after a while this would lead to some MqttNoMemory errors.

The log comes from this line - https://github.com/FreeRTOS/coreMQTT-Agent/blob/main/source/core_mqtt_agent.c#L415

It indicates that you are getting some ACKs on session resumption for which there is no packet waiting to be ACKed. The possible reasons are -

  • You could not store the packet because pPendingAcks array was full.
  • These are duplicate ACKs.

In either case, these will not exhaust memory.