[PIP] Add `StartPaused` option to `ConsumerOptions`
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- go
- Ambito
- api, distributed-systems
Direzione di ricerca
Inizia con ConsumerOptions, Subscribe e il comportamento di pausa/ripresa di #1504; traccia la propagazione delle opzioni attraverso la creazione di consumer partizionati, multi-topic e regex. Il lavoro è completato quando StartPaused impedisce i messaggi prima di Resume(), Paused() è true immediatamente dopo Subscribe() e anche i figli appena scoperti vengono avviati in pausa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Depends on #1504 (adds Pause() / Resume() / Paused()). Related: #429.
With Pause() from #1504, there's a small gap that can't be avoided: between Subscribe()
returning and the new Pause() call, the consumer has already asked the broker for messages and may have pulled some. So there's no way to start a consumer that is paused from the very first moment.
StartPaused closes that gap: the consumer comes up paused and doesn't ask the broker for anything until a user calls Resume().
Java has this on the builder:
ConsumerBuilder<T> startPaused(boolean startPaused);
The consumer starts paused, and the setting is passed down to every internal consumer (including topics discovered later), so it's race-free.
Proposed Go API
One new option, no interface change:
// ConsumerOptions
// StartPaused, if true, creates the consumer in the paused state: it sends no flow
// permits until Resume() is called. Default false.
StartPaused bool
After Subscribe(), Paused() returns true until a user calls Resume().
- Pass the option down to the partition consumer and set its paused flag before it starts, so the very first connect sends no permits. #1504 already handles "paused at connect" (it holds the initial grant and flushes it on the first Resume()), so no new mechanism is needed.
- Set the paused flag on the top-level consumer at creation, so
Paused()is correct and
new children inherit it. - With this in place, regex and partitioned consumers can create new children already paused instead of pausing them right after creation (#1504's current approach, which has a tiny race window). This closes that race and matches Java.
Edge cases to test
StartPaused: true, produce messages,Receivewith a timeout → nothing arrives; afterResume()→ all messages arrive.Paused()is true right afterSubscribe.- Partitioned, multi-topic, and regex consumers all come up paused, including topics discovered later.
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Lingua principale
- Go
- Stelle
- 746
- Fork
- 394
- Merge medio
- 6g 13h
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un 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 apache/pulsar-client-go
-
[Bug] Default key routing (JavaStringHash) picks a different partition than the Java client for about half of keysForse già presa @0z5a l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/pulsar-client-go#1575 ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Concurrent transactional ACKs can crash in registerAckTopicForse già presa @Ebispongebob l’ha presa 73 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/pulsar-client-go#1536 ·
I maintainer di solito rispondono entro 2 giorni
-
Nil pointer panic in `sendRequest.done()` during producer reconnection via `FailTimeoutMessages`Forse già presa @nodece l’ha presa 186 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/pulsar-client-go#1497 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug][Consumer] Throughput collapse and permanent deadlock on large payloads since v0.20.0Forse già presa @HrithikShet l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
apache/pulsar-client-go#1573 ·
I maintainer di solito rispondono entro 2 giorni
-
[Bug] Lookup retries use a fixed backoff that doubles to 60 s, so a reconnect during a broker outage can sleep through the failoverForse già presa @EdwardShen125 l’ha presa 26 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 54/100
apache/pulsar-client-go#1554 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/pulsar-client-go
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
otelc go test fails for .go file targets with 'multiple packages found for file targets'Forse già presa @Aryanbhargava18 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-telemetry/opentelemetry-go-compile-instrumentation#1877 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
rossoctl/context-guru#1268 ·
I maintainer di solito rispondono entro 1 giorno