yiguolei commented on code in PR #10896:
URL: https://github.com/apache/doris/pull/10896#discussion_r922674424


##########
be/src/io/fs/local_file_reader.cpp:
##########
@@ -39,16 +34,18 @@ LocalFileReader::~LocalFileReader() {
 }
 
 Status LocalFileReader::close() {
-    bool expected = false;
-    if (_closed.compare_exchange_strong(expected, true)) {
-        _file_handle.reset();
-        DorisMetrics::instance()->local_file_open_reading->increment(-1);
+    if (!closed()) {

Review Comment:
   Close method maybe called concurrently, the _fd maybe set to -1 in another 
thread. I think we'd better use lock here.



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