Skip to content

Conversation

@suxiaogang223
Copy link
Contributor

bp: #57436

…perations (apache#57436)

close: apache#56328

Problem Summary:
The current close() method in Scanner class and its derived classes has
thread safety issues in multi-threaded environments. Multiple threads
may call close() simultaneously, leading to:
1. Race conditions: Multiple threads may check _is_closed status and
execute close operations simultaneously
2. Double close: May cause resources to be released or cleaned up
multiple times
3. Potential memory leaks or crash risks
@Thearas
Copy link
Contributor

Thearas commented Nov 3, 2025

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@suxiaogang223
Copy link
Contributor Author

run buildall

@suxiaogang223
Copy link
Contributor Author

run buildall

@morrySnow morrySnow changed the title branch-3.1: [fix](scanner) Make Scanner close() method thread-safe using atomic operations (#57436) branch-3.1: [fix](scanner) Make Scanner close() method thread-safe using atomic operations #57436 Nov 5, 2025
@morrySnow morrySnow merged commit 00d81c8 into apache:branch-3.1 Nov 5, 2025
20 of 21 checks passed
@morrySnow morrySnow mentioned this pull request Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants