Fix metrics probe cntr lifetime#5075
Merged
HofiOne merged 11 commits intosyslog-ng:masterfrom Aug 27, 2024
Merged
Conversation
5d6fd61 to
3c97e7a
Compare
This is the first step of a refactor round that tries to decouple a few dynamic-metric-related units from the cache built around it. The end goal is to fix a lifetime issue that is related to the TLS cache version of this store. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
It is no longer called a "cache", so "retrieve" may express the functionality better. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
This is a preparation step for fixing a lifetime bug related to TLS caching. This unit will be extended with a global cache in order not to make metrics orphaned whenever an ivykis worker stops. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
To denote that this is about templating dynamic counters. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
It would have been better to decouple the metrics template unit from the cache, but this would have had performance implications. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
This is required for merging the TLS-cache into a global cache to avoid making dynamic metrics orphan on thread shutdown. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
This unit has been extended with a global cache in order not to make metrics orphaned whenever an ivykis worker stops (after 10 seconds of inactivity). The global cache requires a lock, but it is only updated on thread shutdown. The global cache is purged during reload. Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
Signed-off-by: László Várady <[email protected]> Signed-off-by: Hofi <[email protected]>
3c97e7a to
4374a68
Compare
therandomstring
approved these changes
Aug 27, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on #5073
The TLS cache of metrics-probe() has been extended with a global cache in order not to make metrics orphaned whenever an ivykis worker stops (after 10 seconds of inactivity).
The global cache requires a lock, but it is only updated on thread shutdown. It is purged during reload.
Refactor overview:
Also tried to decouple metrics-template from the cache functionality, but it would have had performance implications, so only added a comment about the coupled functionality.
Backport of #243 by @MrAnno