PublicationAwaiter reads the checkpoint every poll period even when nothing is waiting
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- go
- Ambito
- backend, performance
Direzione di ricerca
Read await.go, especially pollLoop and the PublicationAwaiter documentation, then run the linked TestAwait_noReadsWhileIdle repro from await_test.go. The issue describes counting blocked Await calls and skipping reads and broadcasts when none are waiting; done means the test passes with no checkpoint reads while idle or after Await returns. A linked open pull request already addresses this work.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Reviewed and filed by me, a human. The investigation, repro and fix were developed with the assistance of an AI coding agent.
Summary: the PublicationAwaiter's poll loop reads the checkpoint every poll period for as long as its context lives, whether or not any Await call is waiting. The type's doc says it "will fetch checkpoints whenever it has clients waiting" (await.go:49). That costs a read every poll period, even for a log that receives no writes:
- 864,000 reads a day at the 100ms period the POSIX one-shot example uses (posix-oneshot/main.go:132);
- 432,000 a day at the MTC log's 200ms default (mtc.go:47).
With the S3 or GCS drivers, each read is a GET. At the listed prices (October 2026), that's about $10 a month per process on S3 Standard or GCS Standard at a 100ms poll period, and about $5 at 200ms; on Cloudflare R2, about $5.70 a month at 100ms beyond its free 10 million reads. Small, but paid by every instance for doing nothing.
Where (main at 012e9e0): pollLoop reads on every tick, at await.go:136–138, and then broadcasts.
Repro (no external services). In a checkout of main:
git fetch https://github.com/grempe/tessera awaiter-idle-polling && git checkout FETCH_HEAD -- await_test.go
go test . -run TestAwait_noReadsWhileIdle -v
The test runs under synctest, with a 10ms poll period:
- it waits a second with nothing waiting;
- it calls
Awaitonce; - it waits another second.
On main (=== RUN lines omitted; each count is 99 or 100, depending on where the last tick falls):
await_test.go:381: read the checkpoint 99 times in 1s with nothing waiting, want 0
await_test.go:394: read the checkpoint 100 times in the 1s after Await returned, want 0
--- FAIL: TestAwait_noReadsWhileIdle (0.00s)
FAIL
FAIL github.com/transparency-dev/tessera 0.197s
FAIL
Fix: I'll open a PR from the same branch.
- It counts the
Awaitcalls that are blocked, under the existing mutex, and skips the read and the broadcast while there are none. - Why that's safe: a waiter that arrives finds the last checkpoint read. Its size can only be smaller than the log's current one, so it can't satisfy a waiter wrongly, and the next poll reads a fresh one.
- Latency: for the usual call pattern, awaiting a just-added entry, it's unchanged: up to one poll period either way.
#1195 and #1196 rework Await in the same file. This change is small, and either can be rebased on the other.
- Lingua principale
- Go
- Stelle
- 262
- Fork
- 64
- Merge medio
- 1g 6h
- PR unite (30g)
- 20
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di transparency-dev/tessera
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transparency-dev/tessera#1286 ·
I maintainer di solito rispondono entro 1 giorno
-
TestPosixMirrorIntegration fails on macOS: its burst of connections overflows the listen queueForse già presa @grempe l’ha presa 30 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
transparency-dev/tessera#1253 ·
I maintainer di solito rispondono entro 1 giorno
-
Fix tlog-mirror log origin length prefixForse già presa @phbnf l’ha presa 32 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
transparency-dev/tessera#1233 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
AWS: adds fail while object-storage writes are slow (integration's gap lock on Seq)Forse già presa @grempe l’ha presa 30 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
transparency-dev/tessera#1256 ·
I maintainer di solito rispondono entro 1 giorno
-
AWS: MySQL pools are never closed, so reopening a log in one process leaks goroutines and connectionsForse già presa @grempe l’ha presa 13 giorni fa. Aperta
Difficoltà 4/5 1-2 giorni Idoneità per principianti 48/100
transparency-dev/tessera#1251 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di transparency-dev/tessera
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
seaweedfs/seaweed-block#443 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
version-fox/vfox#825 ·
I maintainer di solito rispondono entro 1 giorno
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encodeForse già presa @Indian-boult l’ha presa oggi. Apertabug queries
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ClickHouse/clickhouse-go#2155 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno