Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: reduce excessive logging when database is unreachable#17363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dannykopping merged 8 commits intomainfromdk/17045
Apr 15, 2025

Conversation

dannykopping
Copy link
Contributor

Fixes#17045

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykopping changed the titleReduce excessive logging when database is unreachablefix: reduce excessive logging when database is unreachableApr 11, 2025
p.acquireAndRunOne(client)
err := p.acquireAndRunOne(client)
if err != nil && ctx.Err() == nil { // Only log if context is not done.
p.opts.Logger.Debug(ctx, "retrying to acquire job", slog.F("retry_in_ms", retrier.Delay.Milliseconds()), slog.Error(err))
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Self-review:acquireAndRunOne already logs its own warning - specifically theprovisionerd was unable to acquire job one is logged when the db is unreachable - soDebug is what felt most appropriate to me.

…ailnet control protocol dialerSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykopping marked this pull request as ready for reviewApril 11, 2025 14:50
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
// This needs to be done *after* the server "starts" otherwise it'll fail straight away when trying to initialize.
pdb.MarkUnhealthy()

// Then: the tailnet controller will continually try to dial the coordination endpoint, exceeding its context timeout.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment is wrong, we don't continually retry becauseDialAgent only waits until we hit a dial error. Once the first error is returned the test is complete and we tear down the context.

Furthermore, I don't think the SDKDialAgent is really the thing that you care about testing here. It doesn't handle the retries anyways,tailnet does. Maybe simplify this and just use theWebsocketDialer and ensure it returns an error.

dannykopping reacted with thumbs up emoji
This has a downside of losing the details of the received error, but in this case it seems justified since we need to conditionalize responses based on codersdk.ErrDatabaseNotReachableSigned-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykoppingdannykopping merged commit0b18e45 intomainApr 15, 2025
32 checks passed
@dannykoppingdannykopping deleted the dk/17045 branchApril 15, 2025 08:55
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsApr 15, 2025
@dannykopping
Copy link
ContributorAuthor

/cherry-pick release/2.21

@dannykopping
Copy link
ContributorAuthor

/cherry-pick release/2.20

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@johnstcnjohnstcnjohnstcn approved these changes

@spikecurtisspikecurtisspikecurtis approved these changes

Assignees

@dannykoppingdannykopping

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

bug: Excessive log generation when PostgreSQL database is offline
3 participants
@dannykopping@johnstcn@spikecurtis

[8]ページ先頭

©2009-2025 Movatter.jp