fix(app): adding fixed hash bucket and tidying loose ends#37
Merged
Jacobbrewer1 merged 5 commits intomainfrom Apr 17, 2025
Merged
fix(app): adding fixed hash bucket and tidying loose ends#37Jacobbrewer1 merged 5 commits intomainfrom
Jacobbrewer1 merged 5 commits intomainfrom
Conversation
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Describe your changes
This pull request includes several changes focused on improving error handling, introducing new utility classes, enhancing logging functionality, and refining Kubernetes-related utilities. Below is a categorized summary of the most important changes:
Error Handling Improvements
Startmethod of theAppstruct by replacing log-based error reporting with explicit error propagation for server and async task initialization issues. (app.go, app.goR203-R245)TestApp_Start. (app_test.go, app_test.goL304-R326)New Utility Classes
FixedHashBucketin thecachepackage, implementing a consistent hashing mechanism for bucket indexing. Includes methods for checking key membership, advancing the bucket index, and retrieving bucket properties. (cache/fixed_hash_bucket.go, cache/fixed_hash_bucket.goR1-R51)FixedHashBucketto validate its functionality, including key distribution and index wrapping. (cache/fixed_hash_bucket_test.go, cache/fixed_hash_bucket_test.goR1-R25)Logging Enhancements
dedupeHandler, a newslog.Handlerthat deduplicates log attributes. Includes methods for deduplication, grouping, and immutability. (logging/dedupe_handler.go, logging/dedupe_handler.goR8-R26)dedupeHandlerto ensure correct deduplication, grouping, and record handling. (logging/dedupe_handler_bench_test.go, logging/dedupe_handler_bench_test.goL13-R134)replaceAttrsinlogging/logger.goto handle attribute replacement more robustly, including new tests and benchmarks. (logging/logger.go, [1];logging/logger_test.go, [2]Kubernetes Utility Updates
PodNameutility to retrieve the pod name usingos.Hostname()as the primary method and falling back to theHOSTNAMEenvironment variable. Added a fallback to an empty string if both methods fail. (utils/kubernetes.go, utils/kubernetes.goL15-R27)Minor Improvements
Shutdownmethod toServiceEndpointHashBucketfor cleaning up resources. (cache/service_endpoint_hash_bucket.go, cache/service_endpoint_hash_bucket.goR147)HashBucketandslog.Handlerimplementations to ensure type safety. (cache/service_endpoint_hash_bucket.go, [1];logging/dedupe_handler.go, [2]