@@ -164,7 +164,7 @@ func (r *topicStreamReaderImpl) ReadMessageBatch(
164164 ctx context.Context ,
165165 opts ReadMessageBatchOptions ,
166166) (batch * PublicBatch , err error ) {
167- onDone := trace .TopicOnReaderStreamReadMessages (
167+ onDone := trace .TopicOnReaderReadMessages (
168168 r .cfg .Tracer ,
169169 ctx ,
170170 opts .MinCount ,
@@ -330,7 +330,7 @@ func (r *topicStreamReaderImpl) Commit(ctx context.Context, commitRange commitRa
330330 session = * commitRange .partitionSession
331331 }
332332
333- onDone := trace .TopicOnReaderStreamCommit (
333+ onDone := trace .TopicOnReaderCommit (
334334 r .cfg .Tracer ,
335335 ctx ,
336336 session .Topic ,
@@ -371,7 +371,7 @@ func (r *topicStreamReaderImpl) checkCommitRange(commitRange commitRange) error
371371func (r * topicStreamReaderImpl ) send (msg rawtopicreader.ClientMessage ) error {
372372 err := r .stream .Send (msg )
373373 if err != nil {
374- trace .TopicOnReaderStreamError (r .cfg .Tracer , r .readConnectionID , err )
374+ trace .TopicOnReaderError (r .cfg .Tracer , r .readConnectionID , err )
375375 _ = r .CloseWithError (r .ctx , err )
376376 }
377377 return err
@@ -406,7 +406,7 @@ func (r *topicStreamReaderImpl) setStarted() error {
406406func (r * topicStreamReaderImpl ) initSession () (err error ) {
407407 initMessage := r .cfg .initMessage ()
408408
409- onDone := trace .TopicOnReaderStreamInit (r .cfg .Tracer , r .readConnectionID , initMessage )
409+ onDone := trace .TopicOnReaderInit (r .cfg .Tracer , r .readConnectionID , initMessage )
410410 defer func () {
411411 onDone (r .readConnectionID , err )
412412 }()
@@ -453,9 +453,9 @@ func (r *topicStreamReaderImpl) readMessagesLoop(ctx context.Context) {
453453 for {
454454 serverMessage , err := r .stream .Recv ()
455455 if err != nil {
456- trace .TopicOnReaderStreamError (r .cfg .Tracer , r .readConnectionID , err )
456+ trace .TopicOnReaderError (r .cfg .Tracer , r .readConnectionID , err )
457457 if errors .Is (err , rawtopicreader .ErrUnexpectedMessageType ) {
458- trace .TopicOnReaderStreamUnknownGrpcMessage (r .cfg .Tracer , r .readConnectionID , err )
458+ trace .TopicOnReaderUnknownGrpcMessage (r .cfg .Tracer , r .readConnectionID , err )
459459 // new messages can be added to protocol, it must be backward compatible to old programs
460460 // and skip message is safe
461461 continue
@@ -497,7 +497,7 @@ func (r *topicStreamReaderImpl) readMessagesLoop(ctx context.Context) {
497497 case * rawtopicreader.UpdateTokenResponse :
498498 // skip
499499 default :
500- trace .TopicOnReaderStreamUnknownGrpcMessage (
500+ trace .TopicOnReaderUnknownGrpcMessage (
501501 r .cfg .Tracer ,
502502 r .readConnectionID ,
503503 xerrors .WithStackTrace (xerrors .Wrap (fmt .Errorf (
@@ -537,7 +537,7 @@ func (r *topicStreamReaderImpl) dataRequestLoop(ctx context.Context) {
537537 }
538538
539539 resCapacity := r .addRestBufferBytes (sum )
540- trace .TopicOnReaderStreamSentDataRequest (r .cfg .Tracer , r .readConnectionID , sum , resCapacity )
540+ trace .TopicOnReaderSentDataRequest (r .cfg .Tracer , r .readConnectionID , sum , resCapacity )
541541 if err := r .sendDataRequest (sum ); err != nil {
542542 return
543543 }
@@ -577,7 +577,7 @@ func (r *topicStreamReaderImpl) updateTokenLoop(ctx context.Context) {
577577
578578func (r * topicStreamReaderImpl ) onReadResponse (msg * rawtopicreader.ReadResponse ) (err error ) {
579579 resCapacity := r .addRestBufferBytes (- msg .BytesSize )
580- onDone := trace .TopicOnReaderStreamReceiveDataResponse (r .cfg .Tracer , r .readConnectionID , resCapacity , msg )
580+ onDone := trace .TopicOnReaderReceiveDataResponse (r .cfg .Tracer , r .readConnectionID , resCapacity , msg )
581581 defer func () {
582582 onDone (err )
583583 }()
@@ -624,7 +624,7 @@ func (r *topicStreamReaderImpl) onReadResponse(msg *rawtopicreader.ReadResponse)
624624}
625625
626626func (r * topicStreamReaderImpl ) CloseWithError (ctx context.Context , reason error ) (closeErr error ) {
627- onDone := trace .TopicOnReaderStreamClose (r .cfg .Tracer , r .readConnectionID , reason )
627+ onDone := trace .TopicOnReaderClose (r .cfg .Tracer , r .readConnectionID , reason )
628628 defer onDone (closeErr )
629629
630630 isFirstClose := false
@@ -672,7 +672,7 @@ func (r *topicStreamReaderImpl) onCommitResponse(msg *rawtopicreader.CommitOffse
672672 }
673673 partition .setCommittedOffset (commit .CommittedOffset )
674674
675- trace .TopicOnReaderStreamCommittedNotify (
675+ trace .TopicOnReaderCommittedNotify (
676676 r .cfg .Tracer ,
677677 r .readConnectionID ,
678678 partition .Topic ,
@@ -688,7 +688,7 @@ func (r *topicStreamReaderImpl) onCommitResponse(msg *rawtopicreader.CommitOffse
688688}
689689
690690func (r * topicStreamReaderImpl ) updateToken (ctx context.Context ) {
691- onUpdateToken := trace .TopicOnReaderStreamUpdateToken (
691+ onUpdateToken := trace .TopicOnReaderUpdateToken (
692692 r .cfg .Tracer ,
693693 r .readConnectionID ,
694694 )
@@ -765,11 +765,7 @@ func (r *topicStreamReaderImpl) onStartPartitionSessionRequestFromBuffer(
765765 respMessage .CommitOffset .FromInt64Pointer (commitOffset )
766766 }
767767
768- if err = r .send (respMessage ); err != nil {
769- return err
770- }
771-
772- return nil
768+ return r .send (respMessage )
773769}
774770
775771func (r * topicStreamReaderImpl ) onStopPartitionSessionRequest (m * rawtopicreader.StopPartitionSessionRequest ) error {
0 commit comments