Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent rpc client panic on rpc response if ProducerReady is nil #973

Merged
merged 1 commit into from
Mar 8, 2023
Merged
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
2 changes: 1 addition & 1 deletion pulsar/internal/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ func (c *connection) internalReceivedCommand(cmd *pb.BaseCommand, headersAndPayl
c.handleResponse(cmd.Success.GetRequestId(), cmd)

case pb.BaseCommand_PRODUCER_SUCCESS:
if !*cmd.ProducerSuccess.ProducerReady {
if !cmd.ProducerSuccess.GetProducerReady() {
request, ok := c.findPendingRequest(cmd.ProducerSuccess.GetRequestId())
if ok {
BewareMyPower marked this conversation as resolved.
Show resolved Hide resolved
request.callback(cmd, nil)
Expand Down
2 changes: 1 addition & 1 deletion pulsar/internal/rpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (c *rpcClient) Request(logicalAddr *url.URL, physicalAddr *url.URL, request
// Ignoring producer not ready response.
// Continue to wait for the producer to create successfully
if res.error == nil && *res.RPCResult.Response.Type == pb.BaseCommand_PRODUCER_SUCCESS {
if !*res.RPCResult.Response.ProducerSuccess.ProducerReady {
if !res.RPCResult.Response.ProducerSuccess.GetProducerReady() {
BewareMyPower marked this conversation as resolved.
Show resolved Hide resolved
timeoutCh = nil
break
}
Expand Down