github-actions[bot] commented on code in PR #64224:
URL: https://github.com/apache/doris/pull/64224#discussion_r3393188268


##########
fs_brokers/apache_hdfs_broker/src/main/java/org/apache/doris/broker/hdfs/ClientContextManager.java:
##########
@@ -128,38 +130,20 @@ public synchronized void removeOutputStream(TBrokerFD fd) 
{

Review Comment:
   `activeStreamCount` is the guard that keeps 
`CheckBrokerFileSystemExpirationTask` from closing a recycled 
`BrokerFileSystem` while streams still depend on it, but this decrements the 
guard before `outputStream.close()` runs. In the client-expiration path, the 
recycle thread can observe `activeStreamCount == 0` and close the underlying 
Hadoop `FileSystem` concurrently while this close is still flushing/committing 
the output stream. The same ordering exists for input streams above. Please 
close the stream first and decrement the active-stream count in a `finally` 
after the close attempt, so the recycled filesystem cannot be closed until the 
stream is no longer using it.



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