【已解决】doris 2.0.10查询报错Connection is not available, request timed out after 5000ms

Viewed 68

版本:2.0.10

查询报错,错误信息如下:

errCode = 2, detailMessage = (xxx)[CANCELLED][INTERNAL_ERROR]UdfRuntimeException: Initialize datasource failed:
CAUSED BY: SQLTransientConnectionException: HikariPool-4 - Connection is not available, request timed out after 5000ms.

0#  doris::JniUtil::GetJniExceptionMsg(JNIEnv_*, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /home/zcp/repo_center/doris_release/doris/be/src/util/jni-util.h:117
1#  doris::vectorized::JdbcConnector::open(doris::RuntimeState*, bool) at /var/local/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/basic_string.h:187
2#  doris::vectorized::NewJdbcScanner::open(doris::RuntimeState*) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:446
3#  doris::vectorized::ScannerScheduler::_scanner_scan(doris::vectorized::ScannerScheduler*, doris::vectorized::ScannerContext*, std::shared_ptr<doris::vectorized::VScanner>) at /home/zcp/repo_center/doris_release/doris/be/src/common/status.h:357
4#  std::_Function_handler<void (), doris::vectorized::ScannerScheduler::_schedule_scanners(doris::vectorized::ScannerContext*)::$_1::operator()() const::{lambda()#4}>::_M_invoke(std::_Any_data const&) at /var/local/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:701
5#  doris::WorkThreadPool<true>::work_thread(int) at /var/local/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/atomic_base.h:646
6#  execute_native_thread_routine at /data/gcc-11.1.0/build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/unique_ptr.h:85
7#  start_thread
8#  clone
2 Answers

可能有两个原因

  1. 同时对 catalog 进行的查询太对,超出了默认最大连接数(默认 10)
    可以通过 alter catalog <catalog_name> set properties('connection_pool_max_size' = '30') 调大
  2. doris 和 mysql 之间存在比较大的网络延迟,超过了默认连接获取等待时间(5000ms)
    可通过如下语句调大:
    alter catalog <catalog_name> set properties('connection_pool_max_wait_time' = '10000')