dubbo-go-bot opened a new pull request, #1020: URL: https://github.com/apache/dubbo-go-pixiu/pull/1020
## 🔄 Upstream Sync from Community Fork This PR automatically syncs changes from the community fork to the upstream repository. ### Original Contribution - **Author**: @EmptyCity-111 - **Original PR**: https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/116 - **Merged at**: 2026-08-24 02:57:24 UTC ### Original PR Description --- **What this PR does**: The access-log filter records its start timestamp in `Decode`. When an earlier decode filter returns `filter.Stop`, access-log decode is skipped, but the HTTP connection manager still runs the complete reverse encode chain. The access-log encode path then computes `time.Since` from Go's zero `time.Time`, which saturates at `time.Duration(math.MaxInt64)` and logs `9223372036854775807` nanoseconds. This change: - initializes a per-request fallback start timestamp when the access-log filter is added to the chain; - keeps the existing `Decode` assignment so normally decoded requests retain the current timing boundary; - adds a regression test using the real filter chain, with an earlier filter stopping decode before access logging. There are no filter-chain API or access-log format changes. **Which issue(s) this PR fixes**: Fixes https://github.com/apache/dubbo-go-pixiu/issues/1015 The same MaxInt64 value is visible in the error-path log attached to https://github.com/apache/dubbo-go-pixiu/issues/724. **Special notes for your reviewer**: The fallback timestamp is created per request in `PrepareFilterChain`; it is not shared by the factory. `Decode` still refreshes the timestamp when access-log decode is reached, so the normal request path is unchanged. Before the production change, the new regression test failed with: ```text "2562047h47m16.854775807s" is not less than "1m0s" ``` Validation on the fixed implementation: ```text go test ./pkg/filter/accesslog -run TestEncodeWithoutDecodeReportsBoundedLatency -count=1 go test ./pkg/filter/accesslog -count=1 go test -race ./pkg/filter/accesslog ./pkg/common/extension/filter ./pkg/common/http -count=1 go vet ./pkg/filter/accesslog ./pkg/common/extension/filter ./pkg/common/http golangci-lint run ./pkg/filter/accesslog go test ./... git diff --check ``` All commands pass on `develop` at `60fcbf17` with this change. **Does this PR introduce a user-facing change?**: ```release-note Access logs no longer report MaxInt64 latency when HTTP decode is short-circuited by an earlier filter. ``` ## Summary by Sourcery Ensure access log latency is bounded when HTTP decode is short-circuited by an earlier filter. Bug Fixes: - Prevent access logs from recording MaxInt64 latency when the access-log decode phase is skipped due to an earlier filter stopping decode. Tests: - Add an integration-style test that builds a real filter chain with a short-circuiting decode filter to verify encode-only access logging reports bounded latency. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Access logs now consistently include a valid, bounded latency value, including when request processing stops early. * **Tests** * Added coverage to verify access-log entries are emitted correctly after decode termination and contain parseable latency information. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- All commits preserve original authorship. **Note**: Auto-created when PR #116 was merged into `dubbo-go-pixiu/dubbo-go-pixiu:develop`. cc @EmptyCity-111 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
