Skip to content

Commit

Permalink
go: statspro: Add session lifecycle callbacks to integrate with sessi…
Browse files Browse the repository at this point in the history
…on-aware GC safepoint controller.
  • Loading branch information
reltuk committed Feb 12, 2025
1 parent 846b67e commit 349d147
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/libraries/doltcore/sqle/statspro/auto_refresh.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (p *Provider) InitAutoRefreshWithParams(ctxFactory func(ctx context.Context
}

dSess := dsess.DSessFromSess(sqlCtx.Session)
defer sql.SessionEnd(dSess)
sql.SessionCommandBegin(dSess)
defer sql.SessionCommandEnd(dSess)

ddb, ok := dSess.GetDoltDB(sqlCtx, dbName)
if !ok {
sqlCtx.GetLogger().Debugf("statistics refresh error: database not found %s", dbName)
Expand Down
3 changes: 3 additions & 0 deletions go/libraries/doltcore/sqle/statspro/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func (p *Provider) Configure(ctx context.Context, ctxFactory func(ctx context.Co
if err != nil {
return err
}
defer sql.SessionEnd(loadCtx.Session)
sql.SessionCommandBegin(loadCtx.Session)
defer sql.SessionCommandEnd(loadCtx.Session)

branches := p.getStatsBranches(loadCtx)

Expand Down

0 comments on commit 349d147

Please sign in to comment.