Repository navigation
Conversation
Keep audit settings and the selected backend with the owning client or server. Pass the context through JAAS and request processing, and preserve it across reconnects, quorum role changes and database replacement. Remove the global ZKAuditProvider API. Keep startup failures auditable and validate the server backend before purge, storage or listeners start. Consolidate JAAS fixtures and cover context binding and runtime isolation.
Describe when clients and servers capture audit settings and initialize their backends. Explain the setup order for custom server bootstraps. Document the removal of the static audit API in 3.10.0 and the replacement methods. Clarify that serverStop still describes JVM shutdown.
Contributor
Author
Provide disabled audit contexts in quorum mocks and the Netty connection fixture to avoid null contexts during server setup. Set the WARN threshold explicitly in the JVM pause INFO test so scheduling delays do not divert events to the WARN counter.
A single connection can be closed with a 1% probability. Accept either outcome and verify that the reported count matches the calls to close.
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.
The audit provider currently shares one backend and server identity across the JVM. A client can initialize that backend before an embedded server reads its configuration, so the server's logger choice depends on what ran first.
This follows up on the runtime ownership suggestion in #2473. Each client connection and server now owns an
AuditContext. Server components share their context across quorum role changes and database replacement. Clients keep theirs across JAAS retries and reconnects.Server startup validates the audit backend before starting purge, opening storage or starting listeners. Client backend failures are logged without changing the JAAS result. Audit records keep their existing format, and
serverStopstill runs at JVM shutdown.This is a breaking API change for 3.10.0. It removes
ZKAuditProvider, theAuditHelper.addAuditLogoverloads without a context, and the staticServerCnxnFactory.getUserName(). Code using these APIs needs to migrate and be recompiled. TheAuditLoggerSPI and configuration keys stay the same. The documentation includes migration steps and explains how custom server bootstraps should pass the context before configuring JAAS.The tests cover runtime isolation, startup failures, reconnects, quorum role changes and snapshot restore. Shared fixtures and parameterized cases reduce duplication and the number of test JVMs.