Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
109930: streamProducer: log context errors during spanConfigEventStream.handleUpdate() r=stevendanna a=msbutler

Previously, spanConfigEventStream.handleUpdate() would send context cancellation errors to the spanConfigEventStream error channel. This unfortunately could cause deadlock if there was already an error in the error channel. To prevent this deadlock, handleUpdate() no longer sends context cancelled errors. It seems unecessary to bubble up rangefeedcache errors from handleUpdate() anyway, since rangefeedcache.Run() will also return the error.

Release note: none

Epic: none

Co-authored-by: Michael Butler <[email protected]>
  • Loading branch information
craig[bot] and msbutler committed Sep 5, 2023
2 parents 4825e29 + 1235e82 commit 1f95b88
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (s *spanConfigEventStream) startStreamProcessor(ctx context.Context) {
// Context group responsible for coordinating rangefeed event production with
// ValueGenerator implementation that consumes rangefeed events and forwards them to the
// destination cluster consumer.
streamCtx, sp := tracing.ChildSpan(ctx, "event stream")
streamCtx, sp := tracing.ChildSpan(ctx, "span config event stream")
s.sp = sp
s.streamGroup = ctxgroup.WithContext(streamCtx)
s.streamGroup.GoCtx(withErrCapture(func(ctx context.Context) error {
Expand Down Expand Up @@ -174,7 +174,7 @@ func (s *spanConfigEventStream) Close(ctx context.Context) {
func (s *spanConfigEventStream) handleUpdate(ctx context.Context, update rangefeedcache.Update) {
select {
case <-ctx.Done():
s.errCh <- ctx.Err()
log.Warningf(ctx, "rangefeedcache context cancelled with error %s", ctx.Err())
case s.updateCh <- update:
if update.Type == rangefeedcache.CompleteUpdate {
log.VInfof(ctx, 1, "completed initial scan")
Expand Down

0 comments on commit 1f95b88

Please sign in to comment.