Skip to content

Commit

Permalink
fix(dbm-services): 解决errchan容量太小可能触发的死锁问题 TencentBlueKing#7962
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq committed Nov 14, 2024
1 parent c74cc8b commit d4fafc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func (c *ImportSchemaFromBackendComp) migrateUseMysqlDump() (err error) {
Password: c.GeneralParam.RuntimeAccountParam.AdminPwd,
WorkDir: c.tmpDumpDir,
}
errChan := make(chan error)
errChan := make(chan error, len(c.dumpDbs))
wg := sync.WaitGroup{}
ctrChan := make(chan struct{}, c.maxThreads)
for _, db := range c.dumpDbs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func (m MySQLDumper) Dump() (err error) {
m.init()
var wg sync.WaitGroup
var errs []error
errChan := make(chan error, 1)
concurrencyControl := make(chan struct{}, m.maxConcurrency)
dumpMap := m.GetDumpFileInfo()
errChan := make(chan error, len(dumpMap))
for db, outputFileName := range dumpMap {
dumper := m
dumper.DbNames = []string{db}
Expand Down

0 comments on commit d4fafc4

Please sign in to comment.