Repository navigation
feat(sqled): recognize GaussDB cancel-statement error in workflow terminator (issue #2) - #3310
Merged
Merged
Conversation
…ic error messages based on dbType - Refined the isConnectionTerminatedError function to include dbType checks for MySQL, PostgreSQL, and SQL Server. - Consolidated error message checks to ensure accurate identification of connection termination errors. - Removed redundant checks for PostgreSQL "conn closed" and SQL Server "connection is broken" to streamline logic. This change improves the accuracy of error handling in connection termination scenarios, ensuring that the correct status is set based on the database type.
…tabase types - Added comprehensive test cases for MySQL, PostgreSQL, GaussDB, and SQL Server to validate connection termination error handling. - Included scenarios for both valid and invalid dbType matches to ensure accurate error identification. - Enhanced coverage for edge cases, improving robustness of the error handling logic.
BugsGuru
force-pushed
the
sqle/feat-issue-2
branch
from
May 21, 2026 08:30
954b64b to
1324d71
Compare
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨No code suggestions found for the PR. |
Contributor
BugsGuru
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
canceling statement due to user request) inisConnectionTerminatedError, guarded bydbType == DriverTypeGaussDBto avoid false positives on standard PostgreSQL drivers.(*action).executeso that when the user actively terminates a task and the executor error is recognized as a connection-terminated error, the task status is written asTerminateSuccrather than always falling back toExecuteFailed.Test_isConnectionTerminatedError(total 36) and 11 new cases coveringhasTerminationstate machine and thedecideTaskStatusOnExecErrortruth table; coverage of the modified branch reaches 100%.Related Issue
Fixes http://10.186.18.21/sqle/sqle-gaussdb-plugin/-/issues/2
Test Plan
go vet ./sqle/server/...PASS (golang:1.24.1)go test ./sqle/server/... -count=1PASS (sqled / auditplan)sqle-gaussdb-pluginfeature/issue-2-kill-process MRDescription
新增 dbType 参数于错误判断
区分不同数据库错误模式
优化任务终止状态更新逻辑
扩展单元测试覆盖多种场景
Diagram Walkthrough
File Walkthrough
sqled.go
更新错误匹配与任务状态处理逻辑sqle/server/sqled.go
sqled_terminate_test.go
完善各数据库错误终止测试用例sqle/server/sqled_terminate_test.go