You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we are never clearing the correlationCallbacks map in "IotHubTransport" class, even after the acknowledgement for received cloud to device message has been sent back to the hub. As a result, the size of map will grow endlessly which will result in OutOfMemory Error eventually.
One interesting thing to remember is that only the happy path ends when we send the ack for the received twin update status message. It's possible that the service fails to send the final message (due to service bug or due to us losing connection) and the SDK never executes your change here.
Since we don't know for sure that we'll get to the end of the happy path, we probably need to periodically check this map for very old messages and delete them. Maybe in the sendMessages thread loop?
In your first attempt, you removed the callback from the map once you knew the flow had finished successfully. Is there any reason you got rid of that in this fix?
In your first attempt, you removed the callback from the map once you knew the flow had finished successfully. Is there any reason you got rid of that in this fix?
Hmm, just thought that we should be able to cover that case with this new approach as well. But yeah, keeping it (remove when the flow is complete) seems more straightforward so I will get it back.
In your first attempt, you removed the callback from the map once you knew the flow had finished successfully. Is there any reason you got rid of that in this fix?
Hmm, just thought that we should be able to cover that case with this new approach as well. But yeah, keeping it (remove when the flow is complete) seems more straightforward so I will get it back.
Thanks. I like having both approaches because otherwise we iterate over unnecessary entries in the map several times after it has already finished its purpose. The timeout approach is just to catch the atypical cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix for issue #1629
Currently we are never clearing the
correlationCallbacksmap in "IotHubTransport" class, even after the acknowledgement for received cloud to device message has been sent back to the hub. As a result, the size of map will grow endlessly which will result in OutOfMemory Error eventually.