Code of Conduct
Search before asking
Describe the bug
I added some debug logs and got the below pictures.

We can see kyuubi received a close session request and closed corresponding operation logs. Let say thread A done this work. One log was closed before initialized, so the the OperationLog#close call did not close writer.
|
def close(): Unit = synchronized { |
|
if (!initialized) return |
After that,
OperationLog#write was called by other thread B. Finally, the thread A called
SessionManager#deleteOperationLogSessionDir and cause log file leak.
Affects Version(s)
1.7.1 with #5211 patch
Kyuubi Server Log Output
No response
Kyuubi Engine Log Output
No response
Kyuubi Server Configurations
No response
Kyuubi Engine Configurations
No response
Additional context
Maybe we can delete if (!initialized) return to fix it?
Are you willing to submit PR?
Code of Conduct
Search before asking
Describe the bug
I added some debug logs and got the below pictures.

We can see kyuubi received a close session request and closed corresponding operation logs. Let say thread A done this work. One log was closed before initialized, so the the
OperationLog#closecall did not close writer.kyuubi/kyuubi-common/src/main/scala/org/apache/kyuubi/operation/log/OperationLog.scala
Lines 234 to 235 in 1d6e653
After that,
OperationLog#writewas called by other thread B. Finally, the thread A calledSessionManager#deleteOperationLogSessionDirand cause log file leak.Affects Version(s)
1.7.1 with #5211 patch
Kyuubi Server Log Output
No response
Kyuubi Engine Log Output
No response
Kyuubi Server Configurations
No response
Kyuubi Engine Configurations
No response
Additional context
Maybe we can delete
if (!initialized) returnto fix it?Are you willing to submit PR?