Make message and forward async to avoid contention and losing logs#22
Merged
Make message and forward async to avoid contention and losing logs#22
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==========================================
+ Coverage 88.88% 95.39% +6.50%
==========================================
Files 8 10 +2
Lines 279 543 +264
==========================================
+ Hits 248 518 +270
+ Misses 24 20 -4
+ Partials 7 5 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7387f7c to
23d1f5d
Compare
23d1f5d to
6edcc38
Compare
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.
This pull request introduces a robust asynchronous side-effect processing system to the audit server, focusing on improving request-path latency and providing tunable reliability for notifications and forwarding. It adds async configuration options, implements an async worker and queue system, introduces optional durable (persistent) retry support, and updates documentation and configuration accordingly. Performance benchmarking and tuning guidance are also included.
Key changes:
Asynchronous Side-Effect Processing:
sideTask,enqueueSide,startSideWorkers, etc.) to decouple notifications/forwarding from the request path, significantly reducing request latency under load. (pkg/auditserver/async.go[1]pkg/auditserver/server.go[2] [3] [4] [5]pkg/auditserver/server.go[1]configs/development/config/config.yaml[2]README.md[3] [4]Durable Side-Effect Delivery (Optional):
pkg/auditserver/durable.go[1]pkg/auditserver/server.go[2] [3] [4]Timeouts and Reliability Improvements:
pkg/auditserver/server.go[1] [2]pkg/forwarder/forwarder.go[3] [4] [5]pkg/auditserver/server.go[1] [2]Documentation and Benchmarking:
README.md[1] [2]pkg/auditserver/bench_test.gopkg/auditserver/bench_test.goR1-R43)