Skip to content

修复mongo panic问题,修复try read不关闭reader的问题,并将管道型reader的错误输出 - #560

Merged
wonderflow merged 11 commits into
qiniu:masterfrom
wonderflow:fixmongo
Jun 20, 2018
Merged

wonderflow merged 11 commits into
qiniu:masterfrom
wonderflow:fixmongo

Conversation

@wonderflow

@wonderflow wonderflow commented Jun 19, 2018 •

Copy link
Copy Markdown
Contributor

Fixes [issue number]

Changes

  • 修复mongo的panic
  • 修复try read不关闭reader的问题
  • 暴露出tailx的错误
  • 暴露出mysql的错误
  • 暴露出socket的错误
  • 暴露出snmp的错误
  • 暴露出script的错误
  • 暴露出redis的错误
  • 暴露出mongo的错误
  • 暴露出kafka的错误
  • 暴露出es的错误
  • 暴露出cloudwath的错误

Reviewers

Wiki Changes

  • options1...
  • options2...

Checklist

  • Rebased/mergeable
  • Tests pass
  • Wiki updated

@wonderflow wonderflow changed the title Fixmongo 修复一些问题 Jun 19, 2018
@wonderflow wonderflow changed the title 修复一些问题 修复一些问题,并将管道型reader的错误输出 Jun 19, 2018
@wonderflow wonderflow changed the title 修复一些问题,并将管道型reader的错误输出 修复mongo panic问题,并将管道型reader的错误输出 Jun 19, 2018
@wonderflow
wonderflow requested a review from unknwon June 19, 2018 09:17
Comment thread reader/reader.go Outdated
return rs.NewReader(conf, errDirectReturn)
}

//NewFileBufReader 名字上有歧义,实际上就是NewReader,包括任何类型,保证兼容性,保留

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.

建议改为:// Deprecated: NewFileBufReader 名字上有歧义,实际上就是NewReader,包括任何类型,保证兼容性,保留,这样 Goland 会在被用到的地方提示:NewFileBufReader

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.

好主意

Comment thread reader/http/http.go Outdated
err = h.Start()
if err != nil {
log.Error(err)
return

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.

return "", err

Comment thread reader/snmp/snmp.go Outdated
defer wg.Done()
gs, err1 := s.getConnection(i)
if err1 != nil {
errMux.Lock()

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.

这样的写法是不是太诡异了。。不如弄个 errChan := make(chan error, len(s.Agents)) 在 wg.Wait() 之后一并收集一下?

Comment thread reader/snmp/snmp.go Outdated
if atomic.LoadInt32(&s.Status) == reader.StatusInit {
if err = s.Start(); err != nil {
log.Error(err)
return

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.

return "", err

Comment thread reader/tailx/tailx_test.go Outdated

"github.com/qiniu/log"

"strings"

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.

修复一下分组

@wonderflow wonderflow changed the title 修复mongo panic问题,并将管道型reader的错误输出 修复mongo panic问题,修复try read不关闭reader的问题,并将管道型reader的错误输出 Jun 20, 2018
@unknwon

unknwon commented Jun 20, 2018

Copy link
Copy Markdown
Contributor

LGTM

@wonderflow
wonderflow force-pushed the fixmongo branch 2 times, most recently from a6a8d03 to 8010761 Compare June 20, 2018 03:23
@wangtuo

wangtuo commented Jun 20, 2018

Copy link
Copy Markdown
Contributor

lgtm

@wonderflow
wonderflow merged commit eb2f440 into qiniu:master Jun 20, 2018
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