Skip to content

util/log: make SecondaryLogger a Closer and do the right thing#45695

Merged
tbg merged 2 commits intocockroachdb:masterfrom
knz:20200304-sec-logger
Mar 4, 2020
Merged

util/log: make SecondaryLogger a Closer and do the right thing#45695
tbg merged 2 commits intocockroachdb:masterfrom
knz:20200304-sec-logger

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Mar 4, 2020

Fixes #45641.

Previously, secondary loggers would leak in the global registry.
A previous patch of mine tried to improve the situation by
asynchronously de-registering loggers, but that was not good enough.
This patch fixes that by adding a Close() method to do the job.

Release note: None

@knz knz requested a review from tbg March 4, 2020 11:11
@knz knz requested a review from a team as a code owner March 4, 2020 11:11
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Mar 4, 2020

bors r=tbg

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Mar 4, 2020

bors r=tbg

knz added 2 commits March 4, 2020 15:09
Previously, unavailability of named time zones (issue cockroachdb#36864) was only
causing an error message to be printed on the terminal and the log
files. However, some users were not looking and would instead run
directly into silently incorrect results in SQL.

This change ensures a node doesn't even start when the TZ database is
not ready.

Example output:

```
ERROR: unable to load named timezones
HINT: See: cockroachdb#36864
--
Check that the time zone database is installed on your system, or
set the ZONEINFO environment variable to a Go time zone .zip archive.
Failed running "demo"
```

Release note (cli change): CockroachDB now refuses to start if named
time zones are not properly configured. It is possible to override
this behavior for testing purposes, with the understanding that doing
so will cause incorrect SQL results and other inconsistencies, using
the environment variable `COCKROACH_INCONSISTENT_TIME_ZONES`.
Previously, secondary loggers would leak in the global registry.
A previous patch of mine tried to improve the situation by
asynchronously de-registering loggers, but that was not good enough.
This patch fixes that by adding a `Close()` method to do the job.

Release note: None
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 4, 2020

Build failed (retrying...)

@tbg
Copy link
Copy Markdown
Member

tbg commented Mar 4, 2020

bors r-

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 4, 2020

Canceled

@knz knz force-pushed the 20200304-sec-logger branch from f13e05d to 45a1ac1 Compare March 4, 2020 14:28
@tbg tbg merged commit 45a1ac1 into cockroachdb:master Mar 4, 2020
@knz knz deleted the 20200304-sec-logger branch March 4, 2020 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

util/log: TestSecondaryGC failed

3 participants