MQTTnet: Unobserved exception

Broker: Mosquitto v1.4.14 MQTTnet: v2.6.0

Both the connection and server are stable but exceptions like these happen alot.


 System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> MQTTnet.Exceptions.MqttCommunicationTimedOutException: Exception of type 'MQTTnet.Exceptions.MqttCommunicationTimedOutException' was thrown.

   at MQTTnet.Internal.TaskExtensions.<TimeoutAfter>d__1`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at MQTTnet.Client.MqttPacketDispatcher.<WaitForPacketAsync>d__4.MoveNext()

   --- End of inner exception stack trace ---

   at System.Threading.Tasks.TaskExceptionHolder.Finalize()

---> (Inner Exception #0) MQTTnet.Exceptions.MqttCommunicationTimedOutException: Exception of type 'MQTTnet.Exceptions.MqttCommunicationTimedOutException' was thrown.

   at MQTTnet.Internal.TaskExtensions.<TimeoutAfter>d__1`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at MQTTnet.Client.MqttPacketDispatcher.<WaitForPacketAsync>d__4.MoveNext()<---

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (5 by maintainers)

Most upvoted comments

nope you can publish an array of Messages, or if you simply whant to fire and forget you can wrap publish with an async void method that handles the exception. but thats not good practise