Skip to content

Commit

Permalink
Merge pull request #68 from ydb-platform/ctx_canel_fix
Browse files Browse the repository at this point in the history
Reader error is not fatal in case of ctx cancelation
  • Loading branch information
dcherednik authored Dec 20, 2024
2 parents 6bebf62 + 1bcd724 commit cbae920
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,11 @@ func ReadTopic(ctx context.Context, streamInfo StreamInfo, reader *client.TopicR
for ctx.Err() == nil {
msg, err := reader.ReadMessage(ctx)
if err != nil {
xlog.Fatal(ctx, "Unable to read message", zap.Error(err))
if ctx.Err() != nil {
xlog.Error(ctx, "Unable to read message", zap.Error(err))
} else {
xlog.Fatal(ctx, "Unable to read message, fatal error ctx is not cancelled", zap.Error(err))
}
return
}

Expand Down

0 comments on commit cbae920

Please sign in to comment.