test buffer: failed Next advances the read position
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 30/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 8.1k
- Forks
- 925
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de cloudwego/kitex
-
fix: RegisterService should return errors instead of panicPosiblemente ocupada @AdamMagued la tomó hace 52 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Generic Thrift writer silently truncates out-of-range json.Number integersPosiblemente ocupada @lanqing431 la tomó hace 4 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
-
test buffer: Malloc slices lose writes after buffer growthQuizá libre de nuevo @Tidehyc la tomó hace 31 días y no hay ningún pull request abierto. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 58/100
Todos los issues de cloudwego/kitex
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
eryajf/learning-weekly#260 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
OpenAI embedding client returns batch vectors in response order despite explicit input indicesPosiblemente ocupada @ningsiyuan1024 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
ConcatAgenticMessages loses the approval request ID of a streamed MCP tool callPosiblemente ocupada @ningsiyuan1024 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
Los mantenedores suelen responder en 1 día