-
Notifications
You must be signed in to change notification settings - Fork 4.1k
log: drain all buffered log messages during the final flush by the buffered sink #72455
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-loggingIn and around the logging infrastructure.In and around the logging infrastructure.A-server-start-drainPertains to server startup and shutdown sequencesPertains to server startup and shutdown sequencesC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-server-and-securityDB Server & SecurityDB Server & Security
Description
This is follow up work to #70330.
When the server shuts down, this is indicated to the accumulator via the context.Done() channel.
When this happens, the accumulator consumes at most 1 of the log messages buffered so far on messageCh. If there were more messages there, they get lost.
The code should be updated to loop over messageCh until the read blocks.
(Also, we would want the shutdown to be signalled to the logging system as late as possible. Perhaps a different context cancellation should be used, that is only called very late in the server startup sequence).
Jira issue: CRDB-11163
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-loggingIn and around the logging infrastructure.In and around the logging infrastructure.A-server-start-drainPertains to server startup and shutdown sequencesPertains to server startup and shutdown sequencesC-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.T-server-and-securityDB Server & SecurityDB Server & Security