Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Close consumer resources if creation fails (#1070)
### Motivation When a consumer fails to get created, we should close any resources that it created to prevent leaks of internal resources and leaks of the consumer on the broker side. The broker leak could happen if the connection was left open. These fixes are similar to #1061. ### Modifications * Close `ackGroupingTracker` and `chunkedMsgCtxMap` if `grabConn` fails. We cannot call `Close` on the consumer because the state is not `Ready`. If we re-design the consumer, it could be nice to be able to call `Close` in this scenario. * Call `Close` on the consumer in cases where we move it to `Ready` but determine it is not able to be created. * Fix typo in comment (cherry picked from commit a3fcc9a)
- Loading branch information