Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cmd/kafka-consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ func (c *consumer) readMessage(ctx context.Context) error {
log.Error("read message failed, just continue to retry", zap.Error(err))
continue
}
needCommit := c.writer.WriteMessage(ctx, msg)
needCommit, err := c.writer.WriteMessage(ctx, msg)
if err != nil {
return err
}
if !needCommit {
continue
}
Expand All @@ -169,7 +172,13 @@ func (c *consumer) readMessage(ctx context.Context) error {
}

// Run the consumer, read data and write to the downstream target.
func (c *consumer) Run(ctx context.Context) error {
func (c *consumer) Run(ctx context.Context) (err error) {
defer func() {
if cleanupErr := c.writer.cleanupEventsGroups(); err == nil && cleanupErr != nil {
err = cleanupErr
}
}()

g, ctx := errgroup.WithContext(ctx)
g.Go(func() error {
return c.writer.run(ctx)
Expand Down
2 changes: 1 addition & 1 deletion cmd/kafka-consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var (
)

func main() {
debug.SetMemoryLimit(14 * 1024 * 1024 * 1024)
debug.SetMemoryLimit(8 * 1024 * 1024 * 1024)
var (
upstreamURIStr string
configFile string
Expand Down
Loading
Loading