Csaba Ringhofer has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24416 )

Change subject: IMPALA-15079: Cleanup Open/Close locking in SharedJdbcConnection
......................................................................


Patch Set 2:

(2 comments)

PS2 also did the rebase whih adds some noise

http://gerrit.cloudera.org:8080/#/c/24416/1/be/src/exec/data-source-scan-node.cc
File be/src/exec/data-source-scan-node.cc:

http://gerrit.cloudera.org:8080/#/c/24416/1/be/src/exec/data-source-scan-node.cc@126
PS1, Line 126: h: another
> Since threads are contending for std::mutex, notify_one() could be called i
open_cv_ was removed


http://gerrit.cloudera.org:8080/#/c/24416/1/be/src/exec/data-source-scan-node.cc@104
PS1, Line 104:     const extdatasource::TOpenParams& params, 
extdatasource::TOpenResult* result) {
             :   std::unique_lock<std::mutex> lk(lock_);
             :   ++ref_count_;
             :   if (ref_count_ > 1) {
             :     // Subsequent callers: wait for the first caller to finish, 
then reuse.
             :     DCHECK(open_done_);
             :     result->__set_scan_handle(scan_handle_);
             :     return open_status_;
             :   }
             :
             :   // First caller: initialize the executor and open the Java 
data source.
             :   // All N C++ scanner threads share this single connection.
             :   Status s = executor_.Init(jar_path, class_name, api_version, 
init_string);
             :   if (s.ok()) s = executor_.Open(params, result);
             :   if (s.ok()) s = StatusFromThrift(result->status);
             :   if (s.ok()) scan_handle_ = result->scan_handle;
             :   open_status_ = s;
             :   open_done_ = true;
             :   return s;
             : }
             :
             : Status 
SharedJdbcConnection::FetchBatch(extdatasource::TGetNextResult* result) {
             :   // Fast path: another thread already exhausted the stream.
             :   i
> I think the simpler the better. std::mutex is completely fine to wait on sl
Done



--
To view, visit http://gerrit.cloudera.org:8080/24416
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9f5c4ac71031b74b51bfa27ed04be10ed92e222
Gerrit-Change-Number: 24416
Gerrit-PatchSet: 2
Gerrit-Owner: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Pranav Lodha <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Fri, 19 Jun 2026 10:51:45 +0000
Gerrit-HasComments: Yes

Reply via email to