Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Close method in Proxy may have a hanging go routine bug #1604

@9iang22

Description

@9iang22

pkg/jaeger/proxy/proxy.go:81

Receiving unbuffered errChan in a select block. That may cause a hanging go routine. Maybe should change errChan to a buffered one.

func (p *Proxy) Close(ctx context.Context, _ *storage_v1.CloseWriterRequest) (*storage_v1.CloseWriterResponse, error) {
	errChan := make(chan error)
	go func() {
		errChan <- p.conn.Close()
		close(errChan)
	}()
	var err error
	select {
	case err = <-errChan:
	case <-ctx.Done():
		err = ctx.Err()
	}
	if err != nil {
		err = fmt.Errorf("error closing connection to Promscale GRPC server: %w", err)
	}
	return nil, err
}

If no influence, please ignore this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions