EmptyCity-111 opened a new issue, #1015:
URL: https://github.com/apache/dubbo-go-pixiu/issues/1015

   ### ✅ Verification Checklist
   
   - [x] I searched existing issues, pull requests, and recent access-log 
commits and found no dedicated fix.
   - [x] The symptom is visible in #724, but it is independent of the 
Docker/WSL networking problem discussed there.
   
   ### 📦 Dubbo-go-pixiu Version
   
   `develop` at `60fcbf17`
   
   ### 📝 Bug Description
   
   The HTTP access-log filter stores its request start timestamp only when 
`Filter.Decode` runs.
   
   The filter chain stops decoding as soon as an earlier filter returns 
`filter.Stop`, but `HttpConnectionManager` still executes the complete reverse 
encode chain. If access logging is configured after the stopping filter, its 
`Encode` method therefore runs while `f.start` is still Go's zero `time.Time`.
   
   `time.Since(f.start)` then saturates at `time.Duration(math.MaxInt64)`, and 
the access log reports:
   
   ```text
   cost time [ 9223372036854775807 ]
   ```
   
   This exact value is visible in the error-path logs attached to #724.
   
   ### 🔄 Steps to Reproduce
   
   1. Create an access-log filter through `FilterFactory.PrepareFilterChain`.
   2. Simulate an earlier decode filter returning `filter.Stop` by invoking the 
access-log encode filter without invoking its decode filter.
   3. Read the emitted access-log entry.
   4. Observe that its duration is `2562047h47m16.854775807s` / 
`9223372036854775807` nanoseconds.
   
   A focused regression test can reproduce this without network services.
   
   ### ✅ Expected Behavior
   
   Short-circuited requests should still have a finite, realistic access-log 
latency.
   
   The access-log filter instance should own a valid fallback start time from 
filter-chain construction, while `Decode` may refresh that timestamp when the 
request reaches the filter normally.
   
   ### ❌ Actual Behavior
   
   The zero start time reaches `time.Since`, producing the maximum 
representable duration.
   
   ### 💡 Proposed Fix
   
   Initialize the per-request access-log filter's start timestamp in 
`PrepareFilterChain`. Keep the existing assignment in `Decode` so normal 
requests preserve the current measurement boundary.
   
   Add a regression test that executes encode without access-log decode and 
asserts a bounded duration.
   
   ### Scope
   
   - No filter-chain API changes.
   - No access-log format changes.
   - No behavior changes for requests that reach the access-log decode phase.
   


-- 
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]

Reply via email to