Repository navigation
Replies: 3 comments
|
One more data point. Run alone, from the same Both hangs in the report happened while other |
TriageVerdict: a reproducible bug in humustest's in-memory network, seen through the order status test. On the Host, crypto/tls's Is this a misuse of humus?No. The test is humus's own: the order status example's App test, which #1066 added for #1011. It dials kfake through humustest's Host inside a synctest bubble, as humustest's docs ask. The package owns the behaviour. The connection is humustest's, a
The end user can't defend against it. The close is franz-go's, from The strongest argument for misuse: franz-go writes on a connection while another of its goroutines closes it, and humustest can't answer for a library that clears crypto/tls's deadline. It doesn't hold. On a real socket the same steps are harmless: the 24-byte alert goes into the kernel's buffer and Is it a feature request?No. The hang contradicts the paragraph above. It promises that each end waits "until crypto/tls's five-second write deadline passes", and that "inside a synctest bubble that wait takes no time". Here the deadline never passes, because it is gone. The docs site's testing page promises the same. It also breaks what #1011's test needs, and what the report expects: a test that ends. Restoring the promise isn't an API change, and neither is correcting the two paragraphs. Is it reproducible?Yes. I ran each test 4 times under
Unforced, it is rare and needs load. None of 1,200 runs of the report's test alone hung, 16 to 40 at a time; 13 failed with #1094's exit 0. One of 240 runs of the whole
With the reset before step 4, the deadline survives and ends the wait: A TLS client on the Host, the reset while
This corrects the report in three places:
The hang isn't specific to the report's test. Any of the package's 16 WhyThree pieces meet. Each is harmless alone.
franz-go's The window that matters is a few lines of Once it happens, nothing in the bubble ends it. Other ways into the same code, which I reasoned from code and didn't reproduce:
#1121 is filed to fix it:
|
|
Fixed by #1123 (story #1121), merged as 418776f. The Host's network no longer uses The triage's reproductions are now tests. The Host scenarios joined humustest's conformance tests, on the Host and, under |
Uh oh!
There was an error while loading. Please reload this page.
What happens
TestInit_cuts_short_a_retried_record_still_waiting_when_the_grace_period_runs_outinexample/orderstatus/appsometimes never ends. It hangs in its last step,p.readAll(t, c, statusTopic)(app_test.go#L635), whenreadAllcloses its own franz-go client (app_test.go#L252-L275). It isn't a deadlock: the process spins at over 100% CPU and the synctest bubble's clock never moves.I found it while triaging #1094. It's a different failure from #1094's, which is an exit 0 at SIGTERM. At 549437f, with Go 1.27.2, franz-go v1.22.2 and kfake v0.0.0-20261018232743-f49d7ddc2cb4, under
-race, it hung:go -C example/orderstatus test -race -count=1 -v -run '^TestInit_cuts_short_a_retried_record_still_waiting_when_the_grace_period_runs_out$' ./app, which ended withpanic: test timed out after 10m0s;./apppackage, from a test binary built with-raceand run without a timeout. It spun at about 140% CPU for 6 minutes until I sent SIGQUIT.Both runs hung at the same place. The goroutines in the bubble, from both dumps:
In the second dump, the request goroutines under
pushMetrics'Broker.requesthave IDs above 413,000, against about 1,500 for the rest of the test. Something keeps starting goroutines.Why
This hasn't been triaged; what follows comes from the dumps and from reading the code.
net.Pipeat once. franz-go's client closes a connection and sends itsclose_notify, while kfake writes a response on the same connection. Neither reads, andnet.Pipehas no buffer. humustest's docs expect this standoff: crypto/tls's five-second write deadline breaks it, and "inside a synctest bubble that wait takes no time".Client.closewaits onkillSessionOnClosewith a one-second timeout, and that timeout never fired either, which is consistent with a clock that never moved.pushMetrics, franz-go's KIP-714 client metrics. OnCloseit sends a terminating push throughRetriableRequest, and kfake answersGetTelemetrySubscriptions. The goroutine IDs suggest that request is retried in a loop that never blocks on a timer. I haven't confirmed which loop it is.Expected
The test ends every time:
readAllcloses its client and returns. It passes under-race -countwithout hanging.References
readAllAll reactions