Skip to content

[internal-dns] servfail test flake? #1200

Closed

Description

@jgallagher

I saw a test failure of servfail on an unrelated PR (link to build log):

test servfail ... FAILED
Jun 13 14:08:26.294 INFO accepted connection, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.294 INFO request completed, response_code: 200, uri: /get-records, method: GET, req_id: 3968fa1c-c0df-4dfa-bc09-6ed9404df6c4, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.295 INFO request completed, response_code: 200, uri: /set-records, method: PUT, req_id: 226d55aa-4ff3-4269-b352-2e9609fd4d50, remote_addr: [::1]:49481, local_addr: [::1]:24284
Jun 13 14:08:26.297 INFO request completed, response_code: 200, uri: /get-records, method: GET, req_id: cf96110c-3b11-437d-be62-845361b459ff, remote_addr: [::1]:49481, local_addr: [::1]:24284
test nxdomain ... ok
Jun 13 14:08:26.299 INFO received request to begin graceful shutdown, local_addr: [::1]:24284
test srv_crud ... ok
failures:
---- servfail stdout ----
Error: error creating server listener: Address already in use (os error 48)
thread 'servfail' panicked at 'assertion failed: `(left == right)`
  left: `1`,
 right: `0`: the test returned a termination value with a non-zero status code (1) which indicates a failure', /rustc/082e4ca49[770](https://github.com/oxidecomputer/omicron/runs/6862289467?check_suite_focus=true#step:10:771)ebc9cb0ee616f3726a67471be8cb/library/test/src/lib.rs:185:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Rerunning the job succeeded. I glanced briefly at the test, which ultimately uses https://docs.rs/portpicker/latest/portpicker/fn.pick_unused_port.html to pick ports. It looks like that inherently has a TOCTOU issue since it tries to bind the port, closes the socket, and then returns the port number on success - maybe we got unlucky and lost that race?

Activity

  1. added
    Test Flake
    on Jun 13, 2022
  2. davepacheco commented on Jun 13, 2022

    @davepacheco
    Collaborator

    Yeah, that approach to picking an unused port seems broken.

  3. self-assigned this
    on Jun 20, 2022
  4. smklein commented on Jun 20, 2022

    @smklein
    Collaborator

    I'm writing a DNS client library; I'll patch this in the process

  5. added a commit that references this issue on Jun 21, 2022
    54ab253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Test Flake

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions