Description

i used gin by file server when request post usually return in 2s but sometime slow call ctx.GetPostForm ( latency over 30s )

How to reproduce

package main

import (
    "github.com/gin-gonic/gin"
)

func (r *Router) Handler(ctx *gin.Context) {
                start := time.Now()
        value, ok := ctx.GetPostForm("value")
        if !ok {
                         //fail
            return
        }

        zap.L().Debug("read finish", zap.Duration("latency", time.Now().Sub(start)))
}

Environment

  • go version: 1.18
  • gin version (or commit ref): 1.8.1
  • operating system: ubuntu kubernetes pod 4C 8GI

Comment From: ben-swit

it is related by https://github.com/gin-gonic/gin/issues/1988

Comment From: ben-swit

https://github.com/golang/go/issues/57551

Comment From: ben-swit

i solved this issue reason by node machine

Comment From: DouFuJuShi

how to resolve?

Comment From: ben-swit

I solved the issue by changing the node machine, but I am still trying to identify the root cause of the problem. Therefore, I suspect the issue may be related to node or network problems.

The cases where issues are expected to arise are presumed to be in the Kubernetes cloud environment. If there are cases where issues are not expected, please leave a comment.