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

Commit4cbc292

Browse files
committed
Log lock acquisition time
Setting default claimer to avoid panicsSigned-off-by: Danny Kopping <danny@coder.com>
1 parent9dd9fed commit4cbc292

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

‎coderd/coderd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,7 @@ func New(options *Options) *API {
566566
f:=appearance.NewDefaultFetcher(api.DeploymentValues.DocsURL.String())
567567
api.AppearanceFetcher.Store(&f)
568568
api.PortSharer.Store(&portsharing.DefaultPortSharer)
569+
api.PrebuildsClaimer.Store(&prebuilds.DefaultClaimer)
569570
buildInfo:= codersdk.BuildInfoResponse{
570571
ExternalURL:buildinfo.ExternalURL(),
571572
Version:buildinfo.Version(),

‎enterprise/coderd/prebuilds/controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,19 @@ func (c *Controller) reconcile(ctx context.Context, templateID *uuid.UUID) {
111111
default:
112112
}
113113

114+
logger.Debug(ctx,"starting reconciliation")
115+
114116
// get all templates or specific one requested
115117
err:=c.store.InTx(func(db database.Store)error {
118+
start:=time.Now()
116119
err:=db.AcquireLock(ctx,database.LockIDReconcileTemplatePrebuilds)
117120
iferr!=nil {
118-
logger.Warn(ctx,"failed to acquire top-level prebuilds lock; likely running on another coderd replica",slog.Error(err))
121+
logger.Warn(ctx,"failed to acquire top-level prebuildsreconciliationlock; likely running on another coderd replica",slog.Error(err))
119122
returnnil
120123
}
121124

125+
deferlogger.Debug(ctx,"acquired top-level prebuilds reconciliation lock",slog.F("acquire_wait_secs",fmt.Sprintf("%.4f",time.Since(start).Seconds())))
126+
122127
innerCtx,cancel:=context.WithTimeout(ctx,time.Second*30)
123128
defercancel()
124129

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp