Skip to content

Commit

Permalink
Minor fix in pubsub (#3120)
Browse files Browse the repository at this point in the history
Not removing the key from the _keyedState dictionary can cause a memory leak if no further messages are sent with this ordering-key. The key not existing in the dictionary has the same meaning as the state being set to Normal.
  • Loading branch information
chrisdunelm committed Jun 11, 2019
1 parent afa4a96 commit 7f24b13
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ public override void ResumePublish(string orderingKey)
{
if (state.State == OrderingKeyState.Error)
{
state.SetState(OrderingKeyState.Normal);
// Remove ordering-key, which signals this ordering-key is in Normal state.
_keyedState.Remove(orderingKey);
}
}
}
Expand Down

0 comments on commit 7f24b13

Please sign in to comment.