Skip to content

fix: KIP-368 use receiver goroutine to process all sasl v1 responses#2234

Merged
dnwe merged 4 commits intoIBM:mainfrom
k-wall:fix-2233
May 30, 2022
Merged

fix: KIP-368 use receiver goroutine to process all sasl v1 responses#2234
dnwe merged 4 commits intoIBM:mainfrom
k-wall:fix-2233

Conversation

@k-wall
Copy link
Copy Markdown
Contributor

@k-wall k-wall commented May 23, 2022

Fixes defect (#2233) in kip-368 implementation where existing incoming wire traffic would get confused with re-authentication traffic leading to unexpected disconnects and OOM errors.

The approach taken uses the existing receiver routine to process all SASL v1+ responses for both authentication and re-authentication. For SASL v0, the existing behaviour is maintained.

k-wall added 4 commits May 23, 2022 21:17
fixes defect in kip-368 implementation where existing incoming wire traffic would get confused with re-authentication traffic
leading to unexpected disconnects and OOM errors.
@ppatierno
Copy link
Copy Markdown
Member

ppatierno commented May 26, 2022

@dnwe do you think is it possible to review and get this fix merged soon? The issue makes the re-auth feature not usable.
Our next Strimzi canary release 0.3.0 was heavily based on this feature but now we are blocked waiting for the fix.
Any chance to have a Sarama patched release 1.33.1 out?

@dnwe dnwe added the fix label May 30, 2022
Copy link
Copy Markdown
Collaborator

@dnwe dnwe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dnwe dnwe changed the title fix: #2233 use receiver goroutine to process all sasl v1 responses fix: use receiver goroutine to process all sasl v1 responses May 30, 2022
@dnwe dnwe merged commit 8e58c77 into IBM:main May 30, 2022
@dnwe dnwe changed the title fix: use receiver goroutine to process all sasl v1 responses fix: KIP-368 use receiver goroutine to process all sasl v1 responses May 30, 2022
@dnwe
Copy link
Copy Markdown
Collaborator

dnwe commented May 30, 2022

@ppatierno no problem, I actually pushed it out as Version 1.34.0 because I wanted to include the KIP-345 (static membership) support to allow people to test that too

@k-wall k-wall deleted the fix-2233 branch May 30, 2022 13:23
@ppatierno
Copy link
Copy Markdown
Member

@dnwe thank you very much!

Comment on lines +249 to +257
b.connErr = b.authenticateViaSASLv1()
if b.connErr != nil {
close(b.responses)
err = b.conn.Close()
if err == nil {
DebugLogger.Printf("Closed connection to broker %s\n", b.addr)
} else {
Logger.Printf("Error while closing connection to broker %s: %s\n", b.addr, err)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @k-wall, I'm wondering if there is there a reason why b.connErr is not logged here too? #2994

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is quite a while ago so I don't have any useful memory. I think it was probably oversight. Looking at the code now, I see no reason why logging connErr would be a bad idea.

If I were making a change, I would double check that connErr never contains a secret.

My project focus has changed, so I'm not contributing to Sarama right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants