Skip to content

Conversation

@fengjun2016
Copy link
Contributor

  1. Panic will not actively release the lock.
  2. This function is called by a goroutine, if panic occurs, the lock will be held until the entire program exits.
s.hdrMu.Lock()
if p := st.Proto(); p != nil && len(p.Details) > 0 {
	delete(s.trailer, grpcStatusDetailsBinHeader)
	stBytes, err := proto.Marshal(p)
	if err != nil {
		// TODO: return error instead, when callers are able to handle it.
		panic(err)
	}

	h.Set(grpcStatusDetailsBinHeader, encodeBinHeader(stBytes))
}

RELEASE NOTES: None

@codecov
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.55%. Comparing base (e524655) to head (1ef7635).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7488      +/-   ##
==========================================
+ Coverage   81.40%   81.55%   +0.15%     
==========================================
  Files         357      357              
  Lines       27243    27224      -19     
==========================================
+ Hits        22176    22203      +27     
+ Misses       3850     3813      -37     
+ Partials     1217     1208       -9     
Files Coverage Δ
internal/transport/handler_server.go 88.00% <100.00%> (-1.34%) ⬇️

... and 22 files with indirect coverage changes

@easwars easwars added this to the 1.66 Release milestone Aug 7, 2024
@arvindbr8 arvindbr8 merged commit f9b96b8 into grpc:master Aug 8, 2024
1 check passed
@fengjun2016 fengjun2016 deleted the bugfix/lock-release branch August 15, 2024 08:57
infovivek2020 pushed a commit to infovivek2020/grpc-go that referenced this pull request Aug 18, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants