Skip to content

fix: name audit logger service for health checks - #23582

Open
exocognosis wants to merge 1 commit into
smartcontractkit:developfrom
exocognosis:fix/audit-logger-service-name
Open

fix: name audit logger service for health checks#23582
exocognosis wants to merge 1 commit into
smartcontractkit:developfrom
exocognosis:fix/audit-logger-service-name

Conversation

@exocognosis

Copy link
Copy Markdown

Summary

Fixes #23571.

Enabling AuditLogger created an AuditLoggerService with the unnamed application logger. The service returned an empty value from Name(). The health checker rejects services with empty names, so application construction failed before the audit logger could start or contact its configured endpoint.

Proposed solution

Assign the canonical AuditLogger name inside 新建AuditLogger before applying the caller helper offset. Service naming is a health-reporting invariant, so the constructor now guarantees that every enabled audit logger can be registered regardless of how its caller configured the parent logger.

The existing audit flow test now passes an unnamed logger, which matches the production call path. A focused regression test creates an enabled audit logger from an unnamed logger and registers it with the real health checker. The test verifies both the canonical service name and successful registration.

The change also includes a patch changeset with the #bugfix and #nops release tags.

Behavior after this change

When audit logging is enabled:

  • The service reports AuditLogger as its health-check name.
  • Application health registration succeeds.
  • Node startup no longer depends on whether the audit endpoint is reachable.
  • Existing asynchronous forwarding and health behavior remain unchanged.

Validation

  • go test ./core/logger/audit -run '^TestAuditLoggerRegistersForHealthChecks$' -count=1
  • go test -race ./core/logger/audit -run '^TestAuditLoggerRegistersForHealthChecks$' -count=1
  • go vet ./core/logger/audit
  • golangci-lint v2.13.1 run ./core/logger/audit/... --new-from-rev=origin/develop --max-same-issues=0 --max-issues-per-linter=0
  • bash .github/scripts/check-changeset-tags.sh .changeset/fix-audit-logger-startup.md
  • git diff --check

The database-backed TestCheckLoginAuditLog test was compiled but not executed locally because the required PostgreSQL test database was not configured. 仓库 CI will run that test with its database environment.

Requires

None.

Supports

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

[NODE] Node crashes on startup when AuditLogger is enabled

1 participant