rproxy: leave no visitor without an answer as the response time runs out (closes #295)
check / check (push) Failing after 5m35s
check / check (push) Failing after 5m35s
A visitor could get a closed connection and no answer when SWRP_MAX_RESPONSE_TIME_MS ran out about when the answer started: the write deadline passed before the first byte was written. - An answer rproxy gives itself has at least 10 seconds to be sent. - An app's answer that arrives once the time has run out is answered 504. - Otherwise the app's status and headers are sent at once, before the body is read, with at least 10 seconds. The exact limit applies to the rest. Model: opus-5-5
This commit is contained in:
1 parent
8ab4280792
commit
fb13d37fa0
5 files changed
+136
-12
No files matched your search
@@ -163,6 +163,8 @@ type responseWriter struct {
|
||||
// status is the final status sent, or zero before one is.
|
||||
status int
|
||||
bytes int64
|
||||
// afterStatus, if set, is called once the final status has been written.
|
||||
afterStatus func()
|
||||
}
|
||||
|
||||
// WriteHeader sends the status and headers. An informational 1xx status is
|
||||
@@ -173,6 +175,10 @@ func (w *responseWriter) WriteHeader(status int) {
|
||||
}
|
||||
|
||||
w.ResponseWriter.WriteHeader(status)
|
||||
|
||||
if status >= http.StatusOK && w.afterStatus != nil {
|
||||
w.afterStatus()
|
||||
}
|
||||
}
|
||||
|
||||
// Write sends part of the body.
|
||||
|
||||
Reference in new issue
Block a user