Skip to content

test failed in CI: test_oximeter_reregistration #6901

Closed

Description

@jgallagher

This test failed on a CI run on #6794:

https://github.com/oxidecomputer/omicron/pull/6794/checks?check_run_id=31733911976

Log showing the specific test failure:

https://buildomat.eng.oxide.computer/wg/0/details/01JAFWKR0V962B2KXK9WB257T0/QuKWDAzMMp3WYt2ahovphvgwOc1gLSM4cCwVzhoqVoR02tm8/01JAFWM1JM94KRNCYGY9J8ZMX7

Excerpt from the log showing the failure:

6316	2024-10-18T13:58:54.822Z	        FAIL [  72.116s] omicron-nexus::test_all integration_tests::oximeter::test_oximeter_reregistration
6317	2024-10-18T13:58:54.822Z	
6318	2024-10-18T13:58:54.822Z	--- STDOUT:              omicron-nexus::test_all integration_tests::oximeter::test_oximeter_reregistration ---
6319	2024-10-18T13:58:54.822Z	
6320	2024-10-18T13:58:54.822Z	running 1 test
6321	2024-10-18T13:58:54.822Z	test integration_tests::oximeter::test_oximeter_reregistration has been running for over 60 seconds
6322	2024-10-18T13:58:54.822Z	test integration_tests::oximeter::test_oximeter_reregistration ... FAILED
6323	2024-10-18T13:58:54.822Z	
6324	2024-10-18T13:58:54.822Z	failures:
6325	2024-10-18T13:58:54.822Z	
6326	2024-10-18T13:58:54.822Z	failures:
6327	2024-10-18T13:58:54.822Z	    integration_tests::oximeter::test_oximeter_reregistration
6328	2024-10-18T13:58:54.822Z	
6329	2024-10-18T13:58:54.822Z	test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 381 filtered out; finished in 72.07s
6330	2024-10-18T13:58:54.822Z	
6331	2024-10-18T13:58:54.823Z	
6332	2024-10-18T13:58:54.823Z	--- STDERR:              omicron-nexus::test_all integration_tests::oximeter::test_oximeter_reregistration ---
6333	2024-10-18T13:58:54.823Z	log file: /var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.0.log
6334	2024-10-18T13:58:54.823Z	note: configured to log to "/var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.0.log"
6335	2024-10-18T13:58:54.823Z	DB URL: postgresql://root@[::1]:40485/omicron?sslmode=disable
6336	2024-10-18T13:58:54.823Z	DB address: [::1]:40485
6337	2024-10-18T13:58:54.823Z	log file: /var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.2.log
6338	2024-10-18T13:58:54.823Z	note: configured to log to "/var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.2.log"
6339	2024-10-18T13:58:54.823Z	log file: /var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.3.log
6340	2024-10-18T13:58:54.823Z	note: configured to log to "/var/tmp/omicron_tmp/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.3.log"
6341	2024-10-18T13:58:54.823Z	thread 'integration_tests::oximeter::test_oximeter_reregistration' panicked at nexus/tests/integration_tests/oximeter.rs:163:14:
6342	2024-10-18T13:58:54.823Z	Failed to retrieve timeseries: TimedOut(60.026376224s)

I strongly suspect this has the same underlying cause as #6895, based on seeing a pruned Oximeter collector in https://buildomat.eng.oxide.computer/wg/0/artefact/01JAFWKR0V962B2KXK9WB257T0/QuKWDAzMMp3WYt2ahovphvgwOc1gLSM4cCwVzhoqVoR02tm8/01JAFWM1JM94KRNCYGY9J8ZMX7/01JAFZZESJF2HPMY867ENBDNQ4/test_all-17f1d182e85394d2-test_oximeter_reregistration.151962.0.log?format=x-bunyan:

2024-10-18T13:57:54.093Z	INFO	test_oximeter_reregistration (oximeter-agent): refreshed list of producers from Nexus
    collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
    collector_ip = ::1
    file = oximeter/collector/src/agent.rs:809
    n_current_tasks = 1
    n_pruned_tasks = 1

Activity

  1. added
    Test Flake
    on Oct 18, 2024
  2. bnaecker commented on Oct 24, 2024

    @bnaecker
    Collaborator

    Saw this flake again on #6925, log is here.

  3. bnaecker commented on Oct 28, 2024

    @bnaecker
    Collaborator

    Closed by #6926

  4. jgallagher commented on Nov 11, 2024

    @jgallagher
    ContributorAuthor

    Ugh, this is still plaguing us: https://buildomat.eng.oxide.computer/wg/0/details/01JC97P46BQQFZ81XPMXNXTXB7/mTvdtg5bU9QV6Tk9BB58HGmPUy8CJUVaLgDDjKoiX6K9AuTJ/01JC97PDJYKG6BN5GF9SJXG9K1#S5721

    I think this is a different flake in the same test:

    I haven't looked at this test enough to propose a new theory, but I don't think this is the same failure we were seeing before.

  5. jgallagher commented on Nov 11, 2024

    @jgallagher
    ContributorAuthor

    This looks suspect: Oximeter's first attempt to list its producers hits the Nexus endpoint once then reports no tasks (as expected if Nexus has no producers for us):

    20:50:26.515Z INFO test_oximeter_reregistration (oximeter): refreshing list of producers from Nexus
        collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
        collector_ip = ::1
        file = oximeter/collector/src/agent.rs:772
    20:50:26.541Z INFO 06b548d3-3da0-4c9f-af5e-73b2eca32132 (dropshot_internal): request completed
        latency_us = 22446
        local_addr = 127.0.0.1:56045
        method = GET
        remote_addr = 127.0.0.1:47050
        req_id = 70170af5-c077-4da5-82ac-25f263979bba
        response_code = 200
        uri = /metrics/collectors/39e6175b-4df2-4730-b11d-cbc1e60a2e78/producers?sort_by=id_ascending
    20:50:26.548Z INFO test_oximeter_reregistration (oximeter): refreshed list of producers from Nexus
        collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
        collector_ip = ::1
        file = oximeter/collector/src/agent.rs:820
        n_current_tasks = 0
        n_pruned_tasks = 0
    

    Two seconds later, we try again; this time we hit Nexus twice (as expected if we get data on the first page - we'll try a second page that then has no results), and we report 2 current tasks:

    20:50:28.455Z INFO test_oximeter_reregistration (oximeter): refreshing list of producers from Nexus
        collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
        collector_ip = ::1
        file = oximeter/collector/src/agent.rs:772
    20:50:28.467Z INFO 06b548d3-3da0-4c9f-af5e-73b2eca32132 (dropshot_internal): request completed
        latency_us = 11031
        local_addr = 127.0.0.1:56045
        method = GET
        remote_addr = 127.0.0.1:47050
        req_id = 11aa8b5d-5b0a-47a9-8b29-7ba63ccfa246
        response_code = 200
        uri = /metrics/collectors/39e6175b-4df2-4730-b11d-cbc1e60a2e78/producers?sort_by=id_ascending
    20:50:28.489Z INFO 06b548d3-3da0-4c9f-af5e-73b2eca32132 (dropshot_internal): request completed
        latency_us = 14871
        local_addr = 127.0.0.1:56045
        method = GET
        remote_addr = 127.0.0.1:47050
        req_id = 242530a9-787b-4001-bca2-959114f1136e
        response_code = 200
        uri = /metrics/collectors/39e6175b-4df2-4730-b11d-cbc1e60a2e78/producers?page_token=eyJ2IjoidjEiLCJwYWdlX3N0YXJ0Ijp7InNvcnRfYnkiOiJpZF9hc2NlbmRpbmciLCJsYXN0X3NlZW4iOiJhNjQ1OGI3ZC04N2MzLTQ0ODMtYmU5Ni04NTRkODE0YzIwZGUifX0%3D
    20:50:28.490Z INFO test_oximeter_reregistration (oximeter): refreshed list of producers from Nexus
        collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
        collector_ip = ::1
        file = oximeter/collector/src/agent.rs:820
        n_current_tasks = 2
        n_pruned_tasks = 0
    

    This latter pattern ("refreshing" => 2 Nexus endpoints hit => "refreshed") repeats every 2 seconds after that... but only 4 times. The 5th time, 10 seconds later, we see the "refreshing" and 2 Nexus endpoints hit, but never see the "refreshed":

    20:50:38.455Z INFO test_oximeter_reregistration (oximeter): refreshing list of producers from Nexus
        collector_id = 39e6175b-4df2-4730-b11d-cbc1e60a2e78
        collector_ip = ::1
        file = oximeter/collector/src/agent.rs:772
    20:50:38.463Z INFO 06b548d3-3da0-4c9f-af5e-73b2eca32132 (dropshot_internal): request completed
        latency_us = 7830
        local_addr = 127.0.0.1:56045
        method = GET
        remote_addr = 127.0.0.1:47050
        req_id = 3653d480-a923-4ef7-86a8-5e57079bd24f
        response_code = 200
        uri = /metrics/collectors/39e6175b-4df2-4730-b11d-cbc1e60a2e78/producers?sort_by=id_ascending
    20:50:38.478Z INFO 06b548d3-3da0-4c9f-af5e-73b2eca32132 (dropshot_internal): request completed
        latency_us = 13449
        local_addr = 127.0.0.1:56045
        method = GET
        remote_addr = 127.0.0.1:47050
        req_id = b4a6ec07-34d5-4dcf-a373-6966b1e11de3
        response_code = 200
        uri = /metrics/collectors/39e6175b-4df2-4730-b11d-cbc1e60a2e78/producers?page_token=eyJ2IjoidjEiLCJwYWdlX3N0YXJ0Ijp7InNvcnRfYnkiOiJpZF9hc2NlbmRpbmciLCJsYXN0X3NlZW4iOiJhNjQ1OGI3ZC04N2MzLTQ0ODMtYmU5Ni04NTRkODE0YzIwZGUifX0%3D
    

    even though the log continues on for another ~50 seconds (which also tracks with the 60s timeout we're seeing).

    Is it possible Oximeter is blocked or deadlocked internally?

  6. jgallagher commented on Nov 11, 2024

    @jgallagher
    ContributorAuthor

    Two theories:

    1. Could the refresh task be blocked waiting for self.collection_tasks.lock()? I don't see any obvious places where that lock could be held for any nontrivial amount of time, except possibly in force_collections(), which leads to theory two...
    2. Could the mpsc queue to the collection task be full? If so, that could cause the .send() inside force_collection() linked above to block, or could cause the send in updating an existing producer's info to block (the latter seems like something this test is doing, I think?).

    I think we're in case 2. Grepping for one of the producer IDs, we get this (I'm showing raw JSON here because looker doesn't like JSON with duplicate address keys, understandably):

     1 {"msg":"assigned collector to new producer","v":0,"name":"test_oximeter_reregistration","level":30,"time":"2024-11-09T20:50:26.590604474Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"component":"nexus","component":"ServerContext","name":"06b548d3-3da0-4c9f-af5e-73b2eca32132","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
     2 {"msg":"registered new metric producer","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:28.490479314Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:41659","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
     3 {"msg":"starting oximeter collection task","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:28.651523142Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"address":"[::1]:41659","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de","component":"collection-task","collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","interval":"1s"}
     4 {"msg":"collecting from producer","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:28.653852689Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"address":"[::1]:41659","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de","component":"collection-task","collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter"}
     5 {"msg":"collected results from producer","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:28.713588276Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"address":"[::1]:41659","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de","component":"collection-task","collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","n_results":1}
     6 {"msg":"assigned collector to new producer","v":0,"name":"test_oximeter_reregistration","level":30,"time":"2024-11-09T20:50:29.100750637Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"component":"nexus","component":"ServerContext","name":"06b548d3-3da0-4c9f-af5e-73b2eca32132","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
     7 {"msg":"collecting from producer","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:29.652169991Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"address":"[::1]:41659","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de","component":"collection-task","collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter"}
     8 {"msg":"received request to register existing metric producer, updating collection information","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:30.479004739Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:63341","interval":"1s","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
     9 {"msg":"received request to register existing metric producer, updating collection information","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:32.495241763Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:63341","interval":"1s","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
    10 {"msg":"received request to register existing metric producer, updating collection information","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:34.478968798Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:63341","interval":"1s","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
    11 {"msg":"received request to register existing metric producer, updating collection information","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:36.476453764Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:63341","interval":"1s","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}
    12 {"msg":"received request to register existing metric producer, updating collection information","v":0,"name":"test_oximeter_reregistration","level":20,"time":"2024-11-09T20:50:38.478898099Z","hostname":"bmat-EVT22200007-00004868","pid":17354,"collector_ip":"::1","collector_id":"39e6175b-4df2-4730-b11d-cbc1e60a2e78","component":"oximeter-agent","component":"oximeter","address":"[::1]:63341","interval":"1s","producer_id":"a6458b7d-87c3-4483-be96-854d814c20de"}

    Lines 1-3 are the normal startup.

    Lines 4-5 are the first time we try (successfully) to collect data from the producer.

    Line 6 is from Nexus; I think that corresponds with the test restarting the producer, which will give it a new port.

    On line 7, the collection task's timer fires and we start trying a collection, using a bare reqwest::Client (which has no timeout, by default). But that collector is gone. We never see a success (unsurprising) or a failure (somewhat surprising!) for that request, so I think we can assume that collector task is blocked in perform_collection().

    On lines 8-12, we're trying to send updated producer info to the collection task. The first four of these get queued, because the channel to that task is created with size 4. The fifth one blocks waiting for room, which never comes because the task isn't pulling anything off the queue.

    I think I'd propose two changes:

    1. Add a timeout to the collection task's reqwest client.
    2. Change the way the collection task handles the collection timer firing such that we don't block pulling new messages on waiting for a collection to run. Maybe we spawn perform_collection(), with a guard that we only have at most one of them running at a time? (I'm not sure what we should do if collection_timer.tick() fires while a previous collection is still running - either ignore it or queue up another collection to run immediately afterwards?) There might also be an argument for canceling an active perform_collection() if we get an CollectionMessage::Update(new_info) that changes the address, since presumably any old collection attempt is doomed.
  7. bnaecker commented on Nov 11, 2024

    @bnaecker
    Collaborator

    Thanks @jgallagher for digging into this. That all makes sense. I thought I had actually created an issue for this problem -- that trying to collect from a defunct producer could block other progress and especially updates to the task handling that one producer. I can't find one though, so I must be thinking of something else.

    I'm not sure about the timeout yet, but I like the second proposal a lot. We can spawn the call to perform_collection(), having that send back its results on a oneshot or similar. Then we can await that oneshot in the main tokio::select! loop inside collection_task(), passing any results it sends on to the outbox.

    I agree with you about canceling any outstanding task running perform_collection() if we get an update message. As far as timer ticks, I'm not sure. If we do queue ticks that happen while we're doing a collection, we should probably limit it to avoid growing it forever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Test Flake

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions