MockWebServer can send extra HTTP/2 stream resets before consuming queued responses
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- kotlin
- Ambito
- networking
Direzione di ricerca
Start by reading Http2SocketHandler.onStream() and dispatchBookkeepingRequest() in MockWebServer.kt, then run HttpOverHttp2Test.recoverFromMultipleRefusedStreamsRequiresNewConnection. Trace when dispatcher.dispatch(request) consumes each queued response relative to sending REFUSED_STREAM. Done means the two scripted refusals are consumed once and the retry receives "abc"; the report says the debugger was needed to reproduce the failure.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Related to #9816
I was investigating HttpOverHttp2Test.recoverFromMultipleRefusedStreamsRequiresNewConnection at 67c4f34e7. The test queues two responses that reset the stream with REFUSED_STREAM, followed by a successful response containing "abc".
In Http2SocketHandler.onStream(), MockWebServer reads dispatcher.peek() and applies onRequestStart before calling dispatchBookkeepingRequest(). For CloseStream, this sends the reset before dispatcher.dispatch(request) consumes the queued response.
Since stream handlers run concurrently, a client can receive the reset and retry while the previous handler has not yet consumed its response. The retry can then observe the same queued response.
I reproduced this with a debugger:
- Run
recoverFromMultipleRefusedStreamsRequiresNewConnection. - Set a breakpoint on
requestQueue.add(request)insidedispatchBookkeepingRequest()inMockWebServer.kt. - Set the breakpoint to suspend only the current thread.
- Leave the handler suspended so the client can retry.
The client received two refusals on the original connection, opened another connection, and received a third refusal there. The call then failed with StreamResetException: REFUSED_STREAM, even though only two refusals were queued.
I would expect each scripted refusal to be consumed once, with the third attempt receiving "abc".
The breakpoint deliberately forces a delay between sending the reset and consuming the response. I haven’t reproduced this exact failure without the debugger or established whether it explains the Windows CI failure that prompted the investigation.
Environment: Arch Linux x86_64, Java 21, Gradle 9.8.2.
- Lingua principale
- Kotlin
- Stelle
- 47.1k
- Fork
- 9.3k
- Merge medio
- 1g 11h
- PR unite (30g)
- 35
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 lysine-dev/okhttp
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
lysine-dev/okhttp#9817 ·
I maintainer di solito rispondono entro 1 giorno
-
Cannot add Content-Length header to a multipart partForse già presa @Amir-Golmoradi l’ha presa 4 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lysine-dev/okhttp#9814 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
lysine-dev/okhttp#9761 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
build-ci
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
lysine-dev/okhttp#9815 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Consider `ForwardingRequestBody`Forse già presa @Amir-Golmoradi l’ha presa 7 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
lysine-dev/okhttp#9800 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lysine-dev/okhttp
Issue simili
-
feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
leonlatsch/Photok#816 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
owenlejeune/ArrMatey#417 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
orgzly-revived/orgzly-android-revived#1120 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Tiqr/eduid-app-android#277 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno