shuke987 opened a new pull request, #65107:
URL: https://github.com/apache/doris/pull/65107

   ### What problem does this PR solve?
   
   `AuditLoader.loadIfNecessary()` is synchronized and resets `auditLogBuffer` 
after stream load, but `assembleAudit()` appended events to the same shared 
`StringBuilder` without holding the same monitor.
   
   When `call flush_audit_log()` forces a load while the audit loader worker is 
assembling a new event, the worker may append to the old buffer after the 
payload has already been materialized for stream load and before `resetBatch()` 
replaces the buffer. That event is then neither included in the current load 
nor retained for the next load.
   
   This can make `flush_audit_log()` miss audit events that have already 
reached the audit plugin pipeline, which matches the flaky 
`test_audit_log_queue_time` symptom.
   
   Related: DORIS-25958
   
   ### Check List
   
   - [x] Added test
   - [ ] This is a behavior change and it is documented
   - [ ] This is a new feature and it is documented
   - [ ] This needs upgrade
   - [ ] This needs downgrade
   
   ### Release note
   
   None
   
   ### Testing
   
   - `git diff --check`
   - Not run: `run-fe-ut.sh --run 
org.apache.doris.plugin.audit.AuditLoaderTest` because local 
`thirdparty/installed/bin/protoc` is missing, and `fe/AGENTS.md` requires 
stopping FE build/test in that case.
   


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