Skip to content

log: fatal log is not written inline in the log file #62768

@andreimatei

Description

@andreimatei

I'm seeing that a log.Fatal only appears in the log file a second after it actually happens. This seems to have something to do with the log message being somehow redirected to the "dev channel"?
I don't quite understand what's going on, but I think it'd be better for the fatal to also appear inline at the point where it happens.
Right now I see this:

I210326 12:02:18.951783 195 1@kv/kvserver/store_raft.go:524 ⋮ [n9,s9,r9/8:‹/Table/1{3-4}›] 485  the server is terminating due to a fatal error (see the DEV channel for details)
...
<more message>
message #618
message #620
<more messages>
F210326 12:02:18.951852 195 kv/kvserver/store_raft.go:524 ⋮ [n9,s9,r9/8:‹/Table/1{3-4}›] 619  ...
<stack trace>

I would like to see (a copy of) the fatal message instead of the "the server is terminating due to a fatal error (see the DEV channel for details)" (this other message I think should not exist), because the point where the fatal happens is important.

Then, I'm a bit confused about how come I'm seeing other messages after a fatal (particularly .5s worth of them) - which fatal I think calls os.Exit() which I'd expect to be fast? And then I'm further confused about why the final message has a counter of 619 - there's probably an explanation, but that counter value doesn't seem to make sense with either the position of the "he server is terminating due to a fatal error" message, nor is it the highest counter in the file.

9.log

Jira issue: CRDB-2670

Metadata

Metadata

Assignees

Labels

A-loggingIn and around the logging infrastructure.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions