-
Bug
-
Resolution: Won't Do
-
Normal
-
None
-
None
-
False
-
None
-
False
-
Yes
-
---
-
---
The PartitionCounter#close ought to be idempotent. At the moment if a caller closes more than once, the reference counting would mean that the singleton would be released prematurely. This could result in a JVM containing two singleton instances!
As the kafka lifecycle seems straightforward, this probably won't actually happen and if it does it will happen as the broker shuts down, so it is probably not too impactful.
Nevertheless, the code should be refactored.