Skip to content

drpcmanager: derive shutdown waiting from active streams#82

Open
shubhamdhama wants to merge 1 commit into
cockroachdb:mainfrom
shubhamdhama:remove-wg-from-manager
Open

drpcmanager: derive shutdown waiting from active streams#82
shubhamdhama wants to merge 1 commit into
cockroachdb:mainfrom
shubhamdhama:remove-wg-from-manager

Conversation

@shubhamdhama

Copy link
Copy Markdown

Each manageStream goroutine already corresponds to one activeStreams entry, so keeping a separate WaitGroup duplicated lifecycle state and forced Add to reach into Manager synchronization.

Keep canceled streams registered until their manage goroutines remove them, then close a completion channel once shutdown has begun and the registry is empty. This preserves the atomic admission-versus-close gate while letting Manager.Close wait on the registry itself.

Each manageStream goroutine already corresponds to one activeStreams entry, so keeping a separate WaitGroup duplicated lifecycle state and forced Add to reach into Manager synchronization.

Keep canceled streams registered until their manage goroutines remove them, then close a completion channel once shutdown has begun and the registry is empty. This preserves the atomic admission-versus-close gate while letting Manager.Close wait on the registry itself.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant