Skip to content

MultiListener doesn't always close underlays that aren't accepted #230#231

Merged
plorenz merged 1 commit intomainfrom
fix-missing-closes
Feb 27, 2026
Merged

MultiListener doesn't always close underlays that aren't accepted #230#231
plorenz merged 1 commit intomainfrom
fix-missing-closes

Conversation

@plorenz
Copy link
Member

@plorenz plorenz commented Feb 27, 2026

No description provided.

@plorenz plorenz requested a review from a team as a code owner February 27, 2026 15:35
Comment on lines 81 to 93
if err != nil || mc == nil {
if mc == nil && err == nil {
err = errors.New("multi-channel factory returned nil")
}
log.WithError(err).Error("failed to create multi-underlay channel")
if closeErr := underlay.Close(); closeErr != nil {
log.WithError(closeErr).Error("error closing underlay")
}
} else {
self.lock.Lock()
self.channels[chId] = mc
self.lock.Unlock()
}
Copy link
Member

@andrewpmartinez andrewpmartinez Feb 27, 2026

Choose a reason for hiding this comment

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

This sucks to read.

nil or nil to both nil or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

I un-nested it to make it clearer

@plorenz plorenz merged commit fd2798a into main Feb 27, 2026
10 checks passed
@plorenz plorenz deleted the fix-missing-closes branch February 27, 2026 18:32
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.

2 participants