Skip to content

Commit

Permalink
Merge #30898
Browse files Browse the repository at this point in the history
30898: log: include a call to action with fatal errors r=knz,petermattis a=tschottdorf

When rare errors happen in the wild, they are a) often unreported or b)
reported only in anonymized form, with little context that can help
pinpoint the root cause.

Users can help us out tremendously by contacting us, and so we should
incentivize that.

Do so by concluding fatal errors (i.e. most crashes) with a call to
action.

Touches #28699.
Touches #24033.
Touches #25173.

Release note: None

Co-authored-by: Tobias Schottdorf <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Oct 3, 2018
2 parents 7cda4be + ff6d5fc commit bbf9825
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
name: Bug report
about: Create a report to help us improve
name: Bug or crash report
about: Report unexpected behavior to help us improve

---

**Describe the bug**
**Describe the problem**

Please describe the issue you observed, and any steps we can take to reproduce it:

Expand All @@ -19,14 +19,21 @@ If possible, provide steps to reproduce the behavior:
3. Look at UI / log file / client app ...
4. See error


**Expected behavior**
A clear and concise description of what you expected to happen.

**Additional data / screenshots**
If applicable, add screenshots / log files to help explain your problem.
If the problem is SQL-related, include a copy of the SQL query and the schema
of the supporting tables.

If a node in your cluster encountered a fatal error, supply the contents of the
log directories (at minimum of the affected node(s), but preferably all nodes).

Note that log files can contain confidential information. Please continue
creating this issue, but contact [email protected] to submit the log
files in private.

If the problem is SQL-related, include a copy of the SQL query and the schema of the supporting tables.
If applicable, add screenshots to help explain your problem.

**Environment:**
- CockroachDB version [e.g. 2.0.x]
Expand Down
26 changes: 26 additions & 0 deletions pkg/util/log/clog.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,30 @@ import (
"github.com/petermattis/goid"
)

const fatalErrorPostamble = `
****************************************************************************
This node experienced a fatal error (printed above this message) as a result
of which the process is terminating.
Fatal errors can occur due to faulty hardware (disks, memory, clocks) or a
problem in CockroachDB. With your help, the support team at Cockroach Labs
can help you determine the root cause, recommend next steps, and will improve
CockroachDB based on your report.
Please consider submitting a report about this crash according to the
instructions at
https://github.com/cockroachdb/cockroach/issues/new/choose
If you would rather not post on a public forum, instead please contact
[email protected]
The Cockroach Labs team appreciates your feedback.
`

// FatalChan is closed when Fatal is called. This can be used to make
// the process stop handling requests while the final log messages and
// crash report are being written.
Expand Down Expand Up @@ -842,6 +866,8 @@ func (l *loggingT) outputLogEntry(s Severity, file string, line int, msg string)
case tracebackAll:
stacks = getStacks(true)
}
stacks = append(stacks, []byte(fatalErrorPostamble)...)

logExitFunc = func(error) {} // If we get a write error, we'll still exit.

// We don't want to hang forever writing our final log message. If
Expand Down

0 comments on commit bbf9825

Please sign in to comment.