forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
76084: sql: run planHooks in a new tracing span r=andreimatei a=andreimatei For some reason, plan hooks run in a new goroutine; that goroutine communicates results through a channel, that's adapted to look like a planNode by the hookFnNode. Before this patch, that goroutine was capturing the caller's ctx, and hence the caller's tracing span. This was leading to span-use-after-Finish because the goroutine in question was sometimes outliving the caller. Although not written anywhere, I think the expectation is that generally the goroutine will not outlive the the hookFnNode by much, since hookFnNode.Next() is supposed to be consumed fully. Still, at the very least, there were races related to ctx cancellation, as the hookFnNode listens for cancellation in parallel with the goroutine running (which is probably a bad idea). This patch fixes ths span use-after-finish by giving the goroutine a new span. I took the opportunity to give all the plan hooks names, and use that as the span name. Since these hooks are all weirdos, it seems like a good idea to particularly reflect them in the trace, regardless of the bug that's being fixed. Fixes cockroachdb#75425 Release note: None 76178: roachtest: add new pgjdbc passing tests r=rafiss a=rafiss fixes cockroachdb#76061 Release note: None Co-authored-by: Andrei Matei <andrei@cockroachlabs.com> Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
- Loading branch information
Showing
12 changed files
with
46 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters