On 24/07/2023 19:02, Aleksandar Lazic wrote:
Are the HAProxy and the FCGI Server on the same host/network or is there any firewall or anything in between?

Both run in the same host. In order to reproduce the problem I had with php-fpm, I am using a simple go fcgi server:

package main

import (
    "fmt"
    "io"
    "log"
    "net"
    "net/http"
    "net/http/fcgi"
)

type FastCGIServer struct{}

func (s FastCGIServer) ServeHTTP(w http.ResponseWriter, req *http.Request) {
    defer req.Body.Close()
    log.Printf("req.ContentLength: %v", req.ContentLength)
    b, err := io.ReadAll(req.Body)
    log.Printf("len: %v, err: %v", len(b), err)
    w.Write([]byte(fmt.Sprintf("This is a FastCGI example server. Input len: %v\n", len(b))))
}

func main() {
    fmt.Println("Starting server...")
    l, _ := net.Listen("tcp", "127.0.0.1:9000")
    b := new(FastCGIServer)
    fcgi.Serve(l, b)
}

What's the error message on the HAProxy and on the FCGI server when the timeout occur?

I am using 3 files:

$ wc -c file*
   1024 file1
  32768 file2
1048576 file3

And I am trying requests like:

curl -F "a=@file2" https://<domain> or curl  --http3-only -F "a=@file1" https://<domain>

When testing with h2, everything is ok. When using h3 with file1 and file2 it's also ok.

But:

curl  --http3-only -F "a=@file3" https://<domain>
curl: (55) ngtcp2_conn_handle_expiry returned error: ERR_IDLE_CLOSE

haproxy logs show:

Jul 24 17:10:31 haproxy[31482]: IP:PORT [24/Jul/2023:17:09:53.685] fe~ fcgiserver/server1 68/0/0/-1/37860 400 191 - - CH-- 1/1/0/0/0 0/0 "POST /test HTTP/3.0"

and the fcgi server shows:

2023/07/24 17:09:53 req.ContentLength: 1048770
2023/07/24 17:10:31 len: 1048770, err: fcgi: request aborted by web server

--yas

Reply via email to