Skip to content

Handling occupied port doesn't work when reuseaddr is enabled #1619

@Lorak-mmk

Description

@Lorak-mmk

Driver has the following logic when using advanced shard awareness:

  • Produce an iterator of port numbers to try to bind locally to.
  • Iterate over it.
  • For each port:
    • Try to open connection using this local port
    • If it works, great. If not, check if the error indicates that the port is occupied
    • If it is, try next port
    • If it is not, return the error

Turns out that when reuseaddr is enabled, a different error (AddrNotAvailable) is returned for occupied port, making adv shard awareness not resilient to occupied ports.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions