Skip to content

feat: GaussDB plugin support + plugin connectivity timeout (CE) #2758#3292

Merged
BugsGuru merged 1 commit into
mainfrom
sqle/feat-2758
May 15, 2026
Merged

feat: GaussDB plugin support + plugin connectivity timeout (CE) #2758#3292
BugsGuru merged 1 commit into
mainfrom
sqle/feat-2758

Conversation

@actiontech-bot
Copy link
Copy Markdown
Member

@actiontech-bot actiontech-bot commented May 9, 2026

User description

Summary

  • Register DriverTypeGaussDB = "GaussDB" in sqle/driver/v2/util.go so the new GaussDB audit plugin can be discovered by SQLE.
  • Harden CheckInstanceIsConnectable with a 60 s total timeout plus a bounded 45 s gRPC deadline on plugin.Init, preventing the data-source connectivity test from hanging indefinitely (observed on Huawei Cloud GaussDB during private SCRAM auth). The fix is plugin-agnostic so it provides defence-in-depth for any future plugin with the same class of bug.
  • Add unit tests under sqle/common/instance_test.go covering the timeout constant range and ctx cancellation contract on Ping.

Test plan

  • go vet -mod=vendor ./sqle/common/... ./sqle/driver/...
  • go test -mod=vendor ./sqle/common/...
  • CI pipelines on the PR

Refs https://github.com/actiontech/sqle-ee/issues/2758


Description

  • 添加 DriverTypeGaussDB 常量

  • 扩展驱动类型列表支持 GaussDB 插件注册


File Walkthrough

Relevant files
Enhancement
util.go
添加 GaussDB 常量支持                                                                                   

sqle/driver/v2/util.go

  • 新增 DriverTypeGaussDB 常量,值为 "GaussDB"
  • 扩展驱动类型列表,支持 GaussDB 审计插件注册
+1/-0     

Add DriverTypeGaussDB = "GaussDB" to the driver type constants in
sqle/driver/v2/util.go, enabling the GaussDB audit plugin to register
with the SQLE platform.

Refs #2758
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

PR Reviewer Guide 🔍

(Review updated until commit 42f9c73)

🎫 Ticket compliance analysis 🔶

2758 - Partially compliant

Compliant requirements:

  • 已完成自测
  • 在关联 issue 中补充实现方案
  • 在关联 issue 中补充测试影响面
  • 确认变更兼容性
  • 确认是否需要更新文档

Non-compliant requirements:

{}

Requires further human verification:

{}

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@actiontech-bot actiontech-bot changed the title feat: add DriverTypeGaussDB constant for GaussDB plugin support feat: GaussDB plugin support + plugin connectivity timeout (CE) #2758 May 15, 2026
@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
支持超时取消

建议在启动新 goroutine 时检测传入的 ctx 是否已超时,并尽量将 ctx 传入
NewDriverManagerWithoutAudit,以便在超时情况下及时中止耗时操作,防止插件初始化过程中可能出现的资源泄露问题。如果 ctx
已取消,应主动返回超时错误,而不是让 goroutine 块在那里等待。

sqle/common/instance.go [34-37]

 go func() {
-    p, err := NewDriverManagerWithoutAudit(log.NewEntry(), instance, "")
-    resultCh <- openResult{plugin: p, err: err}
+    select {
+    case <-ctx.Done():
+        resultCh <- openResult{plugin: nil, err: ctx.Err()}
+    default:
+        p, err := NewDriverManagerWithoutAudit(log.NewEntry(), instance, "")
+        resultCh <- openResult{plugin: p, err: err}
+    }
 }()
Suggestion importance[1-10]: 4

__

Why: The suggestion wraps the goroutine with a context cancellation check, but the outer select on ctx.Done() already handles a timeout scenario. Adding an extra check inside the goroutine introduces complexity without a clear benefit, and it slightly changes the intended control flow.

Low

@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit 42f9c73

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@BugsGuru BugsGuru merged commit 6681790 into main May 15, 2026
7 checks passed
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.

3 participants