HTTP2 go away at the protocol level lets the request hang
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 38/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- swift
- Ambito
- networking
Direzione di ricerca
Inizia da Sources/AsyncHTTPClient/ConnectionPool/HTTP2/HTTP2IdleHandler.swift, in particolare dalla gestione del codice di errore GOAWAY di HTTP/2. Esegui il test di riproduzione testGoAwayFromServerDoesntHangRequest, che usa un body della request non vuoto e una deadline in un futuro lontano. Il lavoro è completato quando la request non rimane più bloccata e il test osserva l’errore lanciato previsto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We currently ignore the error code of the go away. I think if it is a protocol error we will never receive any further HTTP2Frame on the connection or any stream and need manually cancel all active streams. Maybe this is better handled at the nio http2 level but I'm not sure yet.
Reproducer:
func testGoAwayFromServerDoesntHangRequest() throws {
//try XCTSkipIf(true, "this currently hangs")
let bin = HTTPBin(.http2())
defer { XCTAssertNoThrow(try bin.shutdown()) }
let loggerFactor = StreamLogHandler.standardOutput(label:)
var bgLogger = Logger(label: "BG", factory: loggerFactor)
bgLogger.logLevel = .trace
let client = HTTPClient(
eventLoopGroupProvider: .createNew,
configuration: .init(certificateVerification: .none),
backgroundActivityLogger: bgLogger
)
defer { XCTAssertNoThrow(try client.syncShutdown()) }
var request = try HTTPClient.Request(url: bin.baseURL, method: .POST)
// add ~64 KB header
let headerValue = String(repeating: "0", count: 1024)
for headerID in 0..<64 {
request.headers.replaceOrAdd(name: "larg-header-\(headerID)", value: headerValue)
}
// non empty body is important to trigger this bug as we otherwise finish the request in a single flush
request.body = .byteBuffer(ByteBuffer(bytes: [0]))
var rqLogger = Logger(label: "RQ", factory: loggerFactor)
rqLogger.logLevel = .trace
XCTAssertThrows(try client.execute(request: request, deadline: .distantFuture, logger: rqLogger).wait())
}
- Lingua principale
- Swift
- Stelle
- 1.1k
- Fork
- 156
- Merge medio
- 1h 54m
- PR unite (30g)
- 4
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 swift-server/async-http-client
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
-
Invalid state: idleAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
swift-server/async-http-client#927 · 2 commenti ·
-
Windows versionAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
swift-server/async-http-client#923 · 1 commento ·
-
Crash in `HTTP2ClientRequestHandler`Forse già presa @rupayon123 l’ha presa 18 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
Tutte le issue di swift-server/async-http-client
Issue simili
-
bug good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
marcovisona/arca#5 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
luis-guillen/airy#2 ·
-
accessibility bug medium-priority mobile
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
lognorman20/monaco#6247 ·
-
documentation windows
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
521xueweihan/HelloGitHub#4060 ·