gRPC unittests always use the same unix domain socket file path

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • Fully Compatible
    • ALL
    • N&O 2025-10-13
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Using the same file path across unittests can cause subtle issues if the tests are run concurrently. gRPC (and many other servers) will unlink the file before binding which could cause issues for other servers that were actively listening and accepting connections. 

      We tried to fix this in SERVER-82676 by ensuring that each socket name was unique. This was done by specifying the bind port as 0 which would signal to the kernel to choose an ephemeral port. The ephemeral port could then be appended to the filename to create a unique path across test runs. However, the file we create appends 0 into the name rather than the ephemeral port. This means that every unix domain socket filename will be /tmp/mongodb-grpc-0.sock

      We should fix this code to make sure that unix domain sockets have unique filenames across unittests so that concurrently running unittests don't mess around with each other.

            Assignee:
            Joseph Prince
            Reporter:
            Joseph Prince
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: