Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

net/http: transport readLoop deadLock on pc.mu when decConnsPerHost panic #76611

Open
Labels
BugReportIssues describing a possible bug in the Go implementation.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
@yzezzm

Description

@yzezzm

Go version

go version go1.25.4 darwin/arm64

Output ofgo env in your module/workspace:

AR='ar'CC='clang'CGO_CFLAGS='-O2 -g'CGO_CPPFLAGS=''CGO_CXXFLAGS='-O2 -g'CGO_ENABLED='1'CGO_FFLAGS='-O2 -g'CGO_LDFLAGS='-O2 -g'CXX='clang++'GCCGO='gccgo'GO111MODULE='on'GOARCH='arm64'GOARM64='v8.0'GOAUTH='netrc'GOBIN=''GOCACHE='/Users/sh00402ml/Library/Caches/go-build'GOCACHEPROG=''GODEBUG=''GOENV='/Users/sh00402ml/Library/Application Support/go/env'GOEXE=''GOEXPERIMENT=''GOFIPS140='off'GOFLAGS=''GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/s7/kb5yld350f99p10yg8p47z3r0000gq/T/go-build483836918=/tmp/go-build -gno-record-gcc-switches -fno-common'GOHOSTARCH='arm64'GOHOSTOS='darwin'GOINSECURE=''GOMOD='/Users/sh00402ml/GolandProjects/im-server/go.mod'GOMODCACHE='/Users/sh00402ml/go/pkg/mod'GONOPROXY='xxxxx'GONOSUMDB='xxxxx'GOOS='darwin'GOPATH='/Users/sh00402ml/go'GOPRIVATE='xxxx'GOPROXY='https://goproxy.io,direct'GOROOT='/Users/sh00402ml/go/go1.25.4'GOSUMDB='sum.golang.org'GOTELEMETRY='local'GOTELEMETRYDIR='/Users/sh00402ml/Library/Application Support/go/telemetry'GOTMPDIR=''GOTOOLCHAIN='auto'GOTOOLDIR='/Users/sh00402ml/go/go1.25.4/pkg/tool/darwin_arm64'GOVCS=''GOVERSION='go1.25.4'GOWORK=''PKG_CONFIG='pkg-config'

What did you do?

  1. my application was a little bit complicated, i can not write a simple demo to reproduce the bug
  2. but there is a import code line that may help
    http.DefaultTransport.(*http.Transport).MaxConnsPerHost = 100

What did you see happen?

  1. panic happend but the go process does not exit as expected because of a dead lock
Image2. how does the dead lock happend?
  1. readLoopPeekFailLocked -> closeLocked -> decConnsPerHost

  2. then decConnsPerHost panic

  3. back to readLoop, line 2283 did not run, means pc.mu still Locked, then we will run line 2245.

  4. in line 2245 , we want to lock pc.mu while we have got pc.mu Locked, means we are in deadLock

ImageImage
  1. this is the detail gorutine stack text
    panic-goroutine.txt

What did you expect to see?

  1. maybe we should defer the pc.mu.Unlock before we run the func readLoopPeekFailLocked
Image2. if we did so , the panic will cause process exit as expectedImage

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp