Skip to content

improve startup with empty db or discovery config#28552

Merged
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/fix-empty-service-config-init
Jul 3, 2023
Merged

improve startup with empty db or discovery config#28552
GavinFrazar merged 1 commit intomasterfrom
gavinfrazar/fix-empty-service-config-init

Conversation

@GavinFrazar
Copy link
Copy Markdown
Contributor

This is tiny PR to fix log spamming when teleport is started with a discovery service enabled: true but which has an empty config. Prior to this PR, we added DiscoveryReady to the event mapping, but skipped initializing it, so the logs would just spam this message constantly:

2023-06-30T13:20:16-07:00 [PROC:1]    DEBU Teleport not yet ready: still waiting for DiscoveryReady pid:55142.1 service/supervisor.go:415
2023-06-30T13:20:16-07:00 [PROC:1]    DEBU Teleport not yet ready: still waiting for DiscoveryReady pid:55142.1 service/supervisor.go:415
2023-06-30T13:20:16-07:00 [PROC:1]    DEBU Teleport not yet ready: still waiting for DiscoveryReady pid:55142.1 service/supervisor.go:415
2023-06-30T13:20:19-07:00 [PROC:1]    DEBU Teleport not yet ready: still waiting for DiscoveryReady pid:55142.1 service/supervisor.go:415

Instead, it will now print a warning that the enabled service was not initialized due to empty config, and skip adding it to the event mapping.

Copy link
Copy Markdown
Collaborator

@zmb3 zmb3 left a comment

Choose a reason for hiding this comment

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

Good catch.

Comment thread lib/service/service.go Outdated
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from r0mant July 3, 2023 03:53
* log a warning when db/discovery service init is skipped but the service is enabled
* dont register discovery service event mapping when init is skipped to avoid log spam waiting on DiscoveryReady event
* fix godoc for DiscoveryReady event
@GavinFrazar GavinFrazar force-pushed the gavinfrazar/fix-empty-service-config-init branch from d175c65 to a66bea2 Compare July 3, 2023 18:09
@GavinFrazar GavinFrazar enabled auto-merge July 3, 2023 18:09
@GavinFrazar GavinFrazar added this pull request to the merge queue Jul 3, 2023
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 3, 2023
@GavinFrazar GavinFrazar added this pull request to the merge queue Jul 3, 2023
Merged via the queue into master with commit 4b85670 Jul 3, 2023
@GavinFrazar GavinFrazar deleted the gavinfrazar/fix-empty-service-config-init branch July 3, 2023 19:57
@public-teleport-github-review-bot
Copy link
Copy Markdown

@GavinFrazar See the table below for backport results.

Branch Result
branch/v11 Create PR
branch/v12 Create PR
branch/v13 Create PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants