WangzJi commented on code in PR #3023: URL: https://github.com/apache/dubbo-go/pull/3023#discussion_r2343642184
########## filter/accesslog/filter.go: ########## @@ -204,12 +273,52 @@ func (f *Filter) writeLogToFile(data Data) { } } +// getOrOpenLogFile gets or opens the log file with proper caching and handle management +func (f *Filter) getOrOpenLogFile(accessLog string) (*os.File, error) { Review Comment: Yes, exactly! This is the Double-Checked Locking pattern to minimize write lock contention. Why two checks: 1. First check (read lock): Fast path - most requests find existing valid files and return immediately 2. Second check (write lock): Prevents race conditions - ensures another goroutine didn't already create/rotate the file while we were acquiring the write lock -- 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: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org