Repository navigation
Closed
Labels
Test FlakeTests that work. Wait, no. Actually yes. Hang on. Something is broken.
Description
This test failed on a CI run on #6794:
Log showing the specific test failure:
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
Metadata
Metadata
Assignees
Labels
Test FlakeTests that work. Wait, no. Actually yes. Hang on. Something is broken.
Activity
Avoid pruning oximeter producers registered during a refresh
bnaecker commentedon Oct 24, 2024
Saw this flake again on #6925, log is here.
Refresh `oximeter` producer list more aggressively
Refresh `oximeter` producer list more aggressively (#6926)
bnaecker commentedon Oct 28, 2024
Closed by #6926
bnaecker commentedon Nov 10, 2024
Ugh, this is still plaguing us: https://buildomat.eng.oxide.computer/wg/0/details/01JC97P46BQQFZ81XPMXNXTXB7/mTvdtg5bU9QV6Tk9BB58HGmPUy8CJUVaLgDDjKoiX6K9AuTJ/01JC97PDJYKG6BN5GF9SJXG9K1#S5721
jgallagher commentedon Nov 11, 2024
I think this is a different flake in the same test:
Failed to retrieve timeseries: TimedOut(60.026376224s), which is the first time the test tries to read data. In this report, we fail much later (There should be new data after restarting the producer: TimedOut(60.001255087s)), and have already successfully passed several "fetch data" points in the test.refreshed list of producers from Nexuslogs in this failure, the first one reports no current or pruned tasks, but all subsequent ones (at 2 second intervals, as expected) report 2 current tasks and 0 pruned (as expected).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.
jgallagher commentedon Nov 11, 2024
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):
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:
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":
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?
jgallagher commentedon Nov 11, 2024
Two theories:
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 inforce_collections(), which leads to theory two....send()insideforce_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
addresskeys, understandably):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:
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 ifcollection_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 activeperform_collection()if we get anCollectionMessage::Update(new_info)that changes the address, since presumably any old collection attempt is doomed.bnaecker commentedon Nov 11, 2024
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 maintokio::select!loop insidecollection_task(), passing any results it sends on to theoutbox.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.Spawn a task in `oximeter` to actually do the collection
Spawn a task in `oximeter` to actually do the collection (#7097)