Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Error accepting connection from remote causes panic #129

@B3rs

Description

@B3rs

After an error in listener.Accept() remote object can be nil.

remote, err := listener.Accept()

Calling remote.Close() in this line causes a panic.
remote.Close()

We noticed this behaviour because this error Error accepting connection from remote: accept tcp [::]:11211: accept4: too many open files causes our implementation to panic.

Since the wanted behavior is to continue the listener.Accept() loop in case of error, we should wrap this particular remote.Close() call with an if remote != nil statement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions