Skip to content

Commit

Permalink
fixed panic on calling updateMetadata on closed client
Browse files Browse the repository at this point in the history
  • Loading branch information
roblaszczak committed Nov 1, 2019
1 parent 675b0b1 commit a5a3dd2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,10 @@ func (client *client) tryRefreshMetadata(topics []string, attemptsRemaining int,

// if no fatal error, returns a list of topics that need retrying due to ErrLeaderNotAvailable
func (client *client) updateMetadata(data *MetadataResponse, allKnownMetaData bool) (retry bool, err error) {
if client.Closed() {
return
}

client.lock.Lock()
defer client.lock.Unlock()

Expand Down

0 comments on commit a5a3dd2

Please sign in to comment.