test buffer: failed Next advances the read position
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 30/100
Direzione di ricerca
Start by locating the default test ByteBuffer implementation and its Next method; the issue identifies pkg/remote as the package to test. Run go test ./pkg/remote -count=1 and verify that a failed Next leaves ReadLen and ReadableLen unchanged; note that linked pull request #2018 is already open.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
The default remote.ByteBuffer used for tests advances readIdx even when Next(n) fails because fewer than n bytes remain. The failed read changes ReadLen and ReadableLen and prevents a subsequent valid read. This concerns the default test helper; it is not a claim about production transports.
Reproduction
b := remote.NewReaderBuffer([]byte("abc"))
defer b.Release(nil)
b.Next(1) // reads "a"
_, err := b.Next(3) // error: only two bytes remain
fmt.Println(err != nil, b.ReadLen(), b.ReadableLen()) // true 4 -1; expected true 1 2
Current main at 30428b5bfae42d334dbc3653e5b59edcf619fc9a, Go 1.26.3 on Windows. A focused regression test fails before changing Next to advance only when Peek succeeds, and go test ./pkg/remote -count=1 passes with that change.
I searched existing issues and pull requests for defaultByteBuffer, Next, readIdx, and read-position failures; I found no corresponding report. I can submit the small fix and regression test if useful.
AI assistance was used to investigate, implement and test this report.
- Lingua principale
- Go
- Stelle
- 8.1k
- Fork
- 921
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né 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 cloudwego/kitex
-
fix: RegisterService should return errors instead of panicForse già presa @AdamMagued l’ha presa 52 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Generic Thrift writer silently truncates out-of-range json.Number integersForse già presa @lanqing431 l’ha presa 4 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
test buffer: Malloc slices lose writes after buffer growthForse di nuovo libera @Tidehyc l’ha presa 31 giorni fa e non c’è nessuna pull request aperta. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
Tutte le issue di cloudwego/kitex
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
ConcatAgenticMessages loses the approval request ID of a streamed MCP tool callForse già presa @ningsiyuan1024 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
containers/gvisor-tap-vsock#796 ·
I maintainer di solito rispondono entro 2 giorni
-
external needs:triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
celestiaorg/celestia-node#5448 ·
I maintainer di solito rispondono entro 1 giorno