Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix sql error status #2643

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions extensions/sources/sql/ext/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/lf-edge/ekuiper/extensions/sqldatabase/sqlgen"
"github.com/lf-edge/ekuiper/extensions/util"
"github.com/lf-edge/ekuiper/internal/conf"
"github.com/lf-edge/ekuiper/internal/xsql"
"github.com/lf-edge/ekuiper/pkg/api"
"github.com/lf-edge/ekuiper/pkg/cast"
"github.com/lf-edge/ekuiper/pkg/hidden"
Expand Down Expand Up @@ -107,16 +106,12 @@ func (m *sqlsource) Open(ctx api.StreamContext, consumer chan<- api.SourceTuple,
if err != nil {
logger.Errorf("sql source meet error, try to reconnection, err:%v, query:%v", err, query)
if !isConnectionError(err) {
consumer <- &xsql.ErrorSourceTuple{
Error: err,
}
errCh <- err
continue
}
err2 := m.Reconnect()
if err2 != nil {
consumer <- &xsql.ErrorSourceTuple{
Error: fmt.Errorf("reconnect failed, reconnect err:%v", err2),
}
errCh <- fmt.Errorf("reconnect failed, reconnect err:%v", err2)
} else {
logger.Info("sql source reconnect successfully")
}
Expand Down
Loading