Skip to content

reader/sql: improve status check and implement DaemonReader - #670

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
unknwon:daemon-reader-start-sql
Jul 30, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
unknwon:daemon-reader-start-sql

Conversation

@unknwon

@unknwon unknwon commented Jul 30, 2018 •

Copy link
Copy Markdown
Contributor
  1. 实现了 DaemonReader 接口
  2. 优化运行状态检查与关闭退出操作
  3. 修复潜在的 submetas data race
  4. 已实测

image

Comment thread reader/sql/sql.go Outdated
}
time.Sleep(3 * time.Second)
}
log.Warnf("Runner[%v] %q task execution failed and gave up after 10 tries", r.meta.RunnerName, r.Name())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR

Comment thread reader/sql/sql.go

func (r *Reader) hasStopped() bool {
return atomic.LoadInt32(&r.status) == reader.StatusStopped
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

部分 r.status 判断的地方没改全,还是用的 if atomic.LoadInt32(&r.status) == reader.StatusStopping || atomic.LoadInt32(&r.status) == reader.StatusStopped

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改好了

@wonderflow

Copy link
Copy Markdown
Contributor

LGTM

@wonderflow
wonderflow merged commit bf1d119 into qiniu:master Jul 30, 2018
@unknwon
unknwon deleted the daemon-reader-start-sql branch July 30, 2018 09:23
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

⌂ 换网址