-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
101562: pkg/util/log: flush bufferedSinks as part of crash reporter process r=dhartunian a=abarganier It was brought to our attention that SQL pods in serverless environments experiencing panics were not showing the panic logs in downstream log collection systems like Splunk. This caused an investigation into the crash reporter, where we found that the crash reporter *only* flushed the file logging sinks, but *not* the buffered network sinks. Because of this, when the crash reporter logged the panic details to the OPS channel, and the panic log was sent through a fluent-server logging sink, it would simply be buffered. The crash reported would then flush the *file* sinks before propagating the panic again to kill the process. Since we didn't trigger & wait for the flush of the buffered network sinks, the panic almost never made it to the downstream fluentbit collector in time. In the case of SQL pods, where log files are not maintained once the container is destroyed, this meant these panic logs would be lost entirely. This patch updates the log flush system with a new function called `FlushAll`. Previously, we had `Flush`, which would flush all the file logging sinks. This has been renamed to `FlushFileSinks`. Due to its widespread use throughout the code base, we intentionally maintain separation between the flushing of just the file sinks specifically, and the flushing of *all* buffered logging sinks (including network sinks), to avoid changing the semantics of the pre-existing function and its widespread usages. NB: The `FlushAll` is a synchronous operation. It will wait for each buffered logging sink to finish flushing before allowing the crash reporter to proceed. This ensures that the buffers are fully drained prior to propagating the panic and killing the process. Release note: none Fixes: #101369 102084: cli/sql: fix very long pastes r=rafiss a=knz Fixes #102083. Prior to this commit, a paste longer than 99 lines or longer than 1-2KB would be broken up with later pieces not parsed properly. This imports the proper patch from upstream for it. Release note: None 102085: metric: avoid mutex deadlock and fix HdrHistogram.TotalSum r=nvanbenschoten a=nvanbenschoten The method was calling `ToPrometheusMetric`, which expects the mutex to be unlocked. However, it was also locking the mutex. This commit fixes the deadlock. The commit also fixes the implementation, which was broken. `ToPrometheusMetric` does not populate `prometheusgo.Metric.Summary`, so the use of `GetSummary` was broken. The two bugs indicate a lack of testing coverage for this newly introduced functionality (in a28aa6c). We should add some. Epic: None Release note: None Co-authored-by: Alex Barganier <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
- Loading branch information
Showing
45 changed files
with
125 additions
and
87 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1252,10 +1252,10 @@ def go_deps(): | |
name = "com_github_charmbracelet_bubbletea", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/charmbracelet/bubbletea", | ||
sha256 = "2e8c5572800df207d4effccad52fe42cfae26d9a6d797f2c3b43f1be2f964151", | ||
strip_prefix = "github.com/cockroachdb/bubbletea@v0.0.0-20230108112624-1024a1c3e9ae", | ||
sha256 = "d7916a0e7d8d814566e8f8d162c3764aea947296396a0a669564ff3ee53414bc", | ||
strip_prefix = "github.com/cockroachdb/bubbletea@v0.23.1-bracketed-paste2", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/bubbletea/com_github_cockroachdb_bubbletea-v0.0.0-20230108112624-1024a1c3e9ae.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/bubbletea/com_github_cockroachdb_bubbletea-v0.23.1-bracketed-paste2.zip", | ||
], | ||
) | ||
go_repository( | ||
|
@@ -5363,10 +5363,10 @@ def go_deps(): | |
name = "com_github_knz_bubbline", | ||
build_file_proto_mode = "disable_global", | ||
importpath = "github.com/knz/bubbline", | ||
sha256 = "0922c6fae4190a73e2023b1a56401347e29afddf1174990b8fd881433b9c75a9", | ||
strip_prefix = "github.com/knz/[email protected]20230205122847-05558f88fdc4", | ||
sha256 = "b9699be473d5dc3c1254f0e9a26f77a06cc0455135b72c2b82d85146bcfe5863", | ||
strip_prefix = "github.com/knz/[email protected]20230422210153-e176cdfe1c43", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/knz/bubbline/com_github_knz_bubbline-v0.0.0-20230205122847-05558f88fdc4.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/knz/bubbline/com_github_knz_bubbline-v0.0.0-20230422210153-e176cdfe1c43.zip", | ||
], | ||
) | ||
go_repository( | ||
|
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
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
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.