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 fetcher not to return ctx canceled error #208

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

lsjtop10
Copy link
Contributor

@lsjtop10 lsjtop10 commented Jul 16, 2024

Fetcher의 NotifyStop이 호출됐을 때 context를 바로 cancel해버리는데 이때 influxdb에서 에러를 반환해서 비정상 종료로 인식되는 문제가 있습니다.

Comment on lines +107 to +113
e, err := ps.cursor.Next(ctx)

if e.ClosedTime > ps.endTime.Unix() {
select {
case <-ps.stop.Done():
return nil
}

ps.out <- model.Packet{
Time: time.Unix(e.ClosedTime, 0),
Data: e,
default:
if e == nil {
Copy link
Contributor Author

@lsjtop10 lsjtop10 Jul 17, 2024

Choose a reason for hiding this comment

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

Next의 위치가 select문 앞으로 와야 Next()도중 context가 cancel되서 발생한 에러를 반환하지 않을 것 같습니다.

@lsjtop10 lsjtop10 requested a review from mulmuri July 17, 2024 01:46
@lsjtop10
Copy link
Contributor Author

#207

@lsjtop10 lsjtop10 merged commit b23e25f into main Jul 17, 2024
2 checks passed
@lsjtop10 lsjtop10 deleted the fix-fetcher-not-to-return-error-when-stop-notified branch July 17, 2024 02:01
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.

2 participants