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 nil pointer exception when wrapping listener #43201

Merged
merged 1 commit into from
Jun 21, 2024

Conversation

Joerger
Copy link
Contributor

@Joerger Joerger commented Jun 18, 2024

Fixes #24310

Note: this does not fix #9350, which should be solved with better detection/errors around what listeners are necessary and missing.

@@ -180,7 +180,10 @@ func (l *Limiter) StreamServerInterceptor(srv interface{}, serverStream grpc.Ser

// WrapListener returns a [Listener] that wraps the provided listener
// with one that limits connections
func (l *Limiter) WrapListener(ln net.Listener) *Listener {
func (l *Limiter) WrapListener(ln net.Listener) net.Listener {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we be adding nil checks at the call-site now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed WrapListener to return an error instead.

@Joerger Joerger force-pushed the joerger/fix-segfault-on-wrapped-listener branch from c21c46e to 0b5b827 Compare June 18, 2024 19:15
@Joerger Joerger force-pushed the joerger/fix-segfault-on-wrapped-listener branch from 0b5b827 to a97877a Compare June 18, 2024 19:16
@Joerger Joerger added this pull request to the merge queue Jun 21, 2024
Merged via the queue into master with commit d13061b Jun 21, 2024
37 checks passed
@Joerger Joerger deleted the joerger/fix-segfault-on-wrapped-listener branch June 21, 2024 00:51
@public-teleport-github-review-bot

@Joerger See the table below for backport results.

Branch Result
branch/v14 Failed
branch/v15 Failed
branch/v16 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants