In some circumstances DeviceClient.SendEventAsync can go wild, consume all available memory #3342
Labels
bug
Something isn't working.
fix-checked-in
Fix checked into main or preview, but not yet released.
IoTSDK
Tracks all IoT SDK issues across the board
Context
Description of the issue
We have a service whose only job is to read messages from files in a directory and write the contents of those files to IoT hub messages. It has been in service at dozens of sites for several years transferring gigabytes a day without seeing this problem. However, starting a day ago, it seems two IoT hubs have entered a state which seems to cause a message sent with SendEventAsync to block / loop, and consume all available memory. In seconds the process goes from using 70M of memory to 25G and either has to be killed off or the machine rebooted. This only seems to occur under particular circumstances:
At these two sites it takes five minutes or less for the service to enter the "consume all memory" state. The sites appear to be having other probably related problems. The service starts up, sends for about a minute, then logs that it's been disconnected from IoT hub and is reconnecting. A minute later it starts sending again, and a minute after that gets disconnected again. We are still working on getting access to IoT hub logs.
Code sample exhibiting the issue
It's impossible to isolate this to code since the issue is only happening at a couple of production sites and we don't have access to experiment with those IoT hubs. Relevant code included below. The service involves pulling from a BlockingCollection of IQueueMessages and awaiting a call to SendToHub.
Console log of the issue
The service's log at Debug level ends on a line with "Sent # byte message to IoTHub" several seconds before the process had to be killed off. Before that, that message was occurring multiple times a second.
adc_000001.zip
The text was updated successfully, but these errors were encountered: