Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 06e2a9d

Browse files
authoredMar 21, 2025··
fix(worker): use pipeline server host in pipeline client (#989)
Because - The worker needs to make requests to the pipeline server, but this process might be run in a separate container. This commit - Uses the server's instance ID in the configuration to connect to the pipeline server.
1 parent 8925b0f commit 06e2a9d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎pkg/external/external.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ func InitPipelinePublicServiceClient(ctx context.Context) (pipelinepb.PipelinePu
4545
clientDialOpts = grpc.WithTransportCredentials(insecure.NewCredentials())
4646
}
4747

48-
clientConn, err := grpc.NewClient(fmt.Sprintf(":%v", config.Config.Server.PublicPort), clientDialOpts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(constant.MaxPayloadSize), grpc.MaxCallSendMsgSize(constant.MaxPayloadSize)))
48+
// We need to specify the host because several parts of the code (e.g.
49+
// worker) might be deployed in a separate container.
50+
clientConn, err := grpc.NewClient(
51+
fmt.Sprintf("%v:%v", config.Config.Server.InstanceID, config.Config.Server.PublicPort),
52+
clientDialOpts,
53+
grpc.WithDefaultCallOptions(
54+
grpc.MaxCallRecvMsgSize(constant.MaxPayloadSize),
55+
grpc.MaxCallSendMsgSize(constant.MaxPayloadSize),
56+
),
57+
)
4958
if err != nil {
5059
logger.Error(err.Error())
5160
return nil, nil

0 commit comments

Comments
 (0)
Please sign in to comment.