Skip to content

cherry-pick some PRs 2 round#11

Merged
3AceShowHand merged 3 commits intopingcap:v1.41.2-pingcapfrom
3AceShowHand:second-round
Apr 17, 2026
Merged

cherry-pick some PRs 2 round#11
3AceShowHand merged 3 commits intopingcap:v1.41.2-pingcapfrom
3AceShowHand:second-round

Conversation

@3AceShowHand
Copy link
Copy Markdown
Collaborator

No description provided.

dnwe and others added 3 commits April 17, 2026 17:33
This _should_ be a rare edge case as the updateBroker func is only
called from updateMetadata which does already do an up-front
`client.Close()` check under read-lock before then acquiring the write
lock. However, there's potentially a small window of opportunity that if
client.Close() was called whilst metadata refresh was in-flight and for
whatever reason the updateMetadata goroutine gets pre-empted in-between
the readlock release and the write lock acquire then the client could
have been closed and so `client.brokers` will be nil.

I wouldn't have expected this to ever happen, but it was reported by a
user in an older Sarama version in IBM#3391 and there's no harm in adding
the nilguard just in case.

Signed-off-by: Dominic Evans <dominic.evans@uk.ibm.com>
…figs (IBM#2472)

Signed-off-by: zhuliquan <zlqlovecode@foxmail.com>
Co-authored-by: zhuliquan <zlq164114@sina.com>
This is retriable according to the spec: https://kafka.apache.org/protocol.html

Signed-off-by: Richard Artoul <richardartoul@gmail.com>
@3AceShowHand 3AceShowHand merged commit a85c926 into pingcap:v1.41.2-pingcap Apr 17, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants