http3: immediately close all connections on Server.Close (#4689)

* http3: immediately close all connections on Server.Close

* http3: document connection closing when using ServeQUICConn
This commit is contained in:
Marten Seemann
2024-10-09 15:24:13 -05:00
committed by GitHub
parent b2233591ad
commit e5693d0ad7
3 changed files with 46 additions and 24 deletions

View File

@@ -1068,4 +1068,17 @@ var _ = Describe("HTTP tests", func() {
"Unannounced": {"Surprise!"},
})))
})
It("aborts requests on shutdown", func() {
mux.HandleFunc("/shutdown", func(w http.ResponseWriter, r *http.Request) {
defer GinkgoRecover()
Expect(server.Close()).To(Succeed())
})
_, err := client.Get(fmt.Sprintf("https://localhost:%d/shutdown", port))
Expect(err).To(HaveOccurred())
var appErr *http3.Error
Expect(errors.As(err, &appErr)).To(BeTrue())
Expect(appErr.ErrorCode).To(Equal(http3.ErrCodeNoError))
})
})