Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate publishing of data if registry closes within one step #4357

Closed
lenin-jaganathan opened this issue Nov 15, 2023 · 4 comments · Fixed by #4485
Closed

Duplicate publishing of data if registry closes within one step #4357

lenin-jaganathan opened this issue Nov 15, 2023 · 4 comments · Fixed by #4485
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Milestone

Comments

@lenin-jaganathan
Copy link
Contributor

https://github.com/micrometer-metrics/micrometer/blob/8d5aac964bf0f5c44d1c51cd343eaaa77ff7459c/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepMeterRegistry.java#L162C54-L165

https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/push/PushMeterRegistry.java#L40

When closing step registries before completion of the first step, there are 2 publishes happening. It is because isDataPublishedForCurrentStep() returns false when called before first publishing as lastPublishTime is 0.

@lenin-jaganathan lenin-jaganathan changed the title Duplicate publishing of data if registry close within one step Duplicate publishing of data if registry closes within one step Nov 15, 2023
@shakuzen shakuzen added this to the 1.11.7 milestone Nov 15, 2023
@shakuzen shakuzen added bug A general bug module: micrometer-core An issue that is related to our core module labels Nov 15, 2023
@shakuzen
Copy link
Member

Thanks for catching the issue. Did you have a fix you wanted to contribute for this?

@lenin-jaganathan
Copy link
Contributor Author

I will add a PR in some time

@shakuzen
Copy link
Member

Thanks. If you're busy or anything, let us know. We can work on a fix. I just figured if you have a fix in mind, we can wait for that and work on other things in the meantime.

@lenin-jaganathan
Copy link
Contributor Author

Was having a tough couple of weeks. Able to get back to normal now. Will add a PR for this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug module: micrometer-core An issue that is related to our core module
Projects
None yet
2 participants