-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
95516: ui: add proper checks and message for insights r=maryliag a=maryliag Previously, no checks were done on insights when user was not admin, making the page show empty results, even when there was an error retrieving the data. This commit passes on the proper error message when there is one. It also checks for admin privilege to show option to apply a recommendation. https://www.loom.com/share/33d002cc9b704a4fad2f9851109b04ee Epic: CRDB-20388 Release note (ui change): Hide apply option for index recommendation when user is not admin. 95522: sql: fix a possible race between Flow.Cleanup and Flow.Cancel r=yuzefovich a=yuzefovich This commit fixes a possible race that could occur when `Flow.Cleanup` is called by the main goroutine concurrently with `Flow.Cancel` by the listener goroutine (which is not allowed). We already had synchronization in place, but it was insufficient. In particular, the following scenario could lead to a nil pointer crash: - the listener checks whether `Cleanup` has been called, it hasn't, and the mutex is unlocked; - the listener is preemptied; - the main goroutine proceeds to perform the `Cleanup`. At the very end the flow object is unset (including `ctxCancel` overwritten to `nil`); - the listener resumes its execution, proceeds to call `Cancel` on the already-unset `Flow` object, leading to a nil pointer on `ctxCancel` call. This is now fixed by holding the mutex through the call to `Cancel` in the listener goroutine, ensuring that the `Flow` object is not unset from under the listener. Additionally, this commit clarifies the callbacks that are performed at the very beginning and very end of `Cleanup` method. Fixes: #95527. Release note: None Co-authored-by: maryliag <[email protected]> Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information
Showing
32 changed files
with
347 additions
and
140 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
Oops, something went wrong.