ruanwenjun opened a new pull request, #7827:
URL: https://github.com/apache/kyuubi/pull/7827
### Why are the changes needed?
Closes #7826.
Formatting an operation log event may wait for another thread that logs
through the same appender. `AbstractWriterAppender` formats under a read lock,
while `Log4j2DivertAppender` subsequently needs the corresponding write lock.
This can leave both threads waiting indefinitely and block operation
cancellation and session cleanup.
Serialize each event to a local string before writing it to the current
`OperationLog`, whose writes are already synchronized. This also prevents
concurrent events from being mixed in the shared character buffer and written
to another operation's log. Existing appender construction and lifecycle remain
unchanged.
### How was this patch tested?
Added two regressions to `OperationLogSuite`:
- Formatting waits for an executor task that appends another event through
the same appender.
- Concurrent events are written exclusively to their associated operation
logs.
Both new tests failed against the original implementation (timeout and mixed
operation logs). With the fix, all 13 tests in the suite pass.
```bash
build/mvn test -pl kyuubi-common -am \
-Pspark-provided,flink-provided,hive-provided \
-Dtest=none \
-DwildcardSuites=org.apache.kyuubi.operation.log.OperationLogSuite \
-Dsurefire.failIfNoSpecifiedTests=false
dev/reformat
git diff --check
```
Validated locally with JDK 11. Production deployment has not been tested.
### Was this patch assisted by generative AI tooling?
Assisted-by: Codex (GPT-6)
--
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]