-
Notifications
You must be signed in to change notification settings - Fork 4.1k
SQL Proxy Misuses Stopper's Context #77689
Copy link
Copy link
Open
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-cloud-platform
Description
The SQL proxy uses stoper.RunAsyncTask to create a goroutine for each connection. The context created for the async task is passed to child go routines that are spawned using the go command. Stopper attaches a span to the context and the span is returned to a pool when the task returns. During the connection tear down process, child workers may use the task's context. This is inappropriate as it leads to a use after free bug.
Per #58164 the sqlproxy should avoid raw use of the go keyword and should use the stopper to spawn goroutines.
Jira issue: CRDB-13713
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-multitenancyRelated to multi-tenancyRelated to multi-tenancyC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-cloud-platform