-
Notifications
You must be signed in to change notification settings - Fork 300
Remove legacy optimizer decorator path #6119
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,8 +98,8 @@ type Manager struct { | |
| } | ||
|
|
||
| // New creates a Manager backed by the given SessionDataStorage and backend | ||
| // registry. It builds the decorating session factory from cfg, wiring the | ||
| // optimizer and composite tool layers internally. | ||
| // registry. It wraps cfg.Base as the session factory and exposes any resolved | ||
| // optimizer factory for the Serve layer to compose with the core tools. | ||
| // | ||
| // An optimizer (FactoryConfig.OptimizerFactory or OptimizerConfig) requires | ||
| // FactoryConfig.AdvertiseFromCore; New rejects the combination otherwise. The | ||
|
|
@@ -135,8 +135,8 @@ func New( | |
| return nil, nil, err | ||
| } | ||
|
|
||
| // Build the Manager first so we can reference sm.Terminate and sm.sessions | ||
| // directly in closures, eliminating the forward-reference variable pattern. | ||
| // Build the Manager first so cache callbacks can reference sm.loadSession, | ||
| // sm.checkSession, and sm.sessions without a forward-reference variable. | ||
| sm := &Manager{ | ||
| storage: storage, | ||
| backendReg: backendRegistry, | ||
|
|
@@ -168,7 +168,7 @@ func New( | |
| }, | ||
| ) | ||
|
|
||
| sm.factory = buildDecoratingFactory(cfg, optimizerFactory, sm.Terminate) | ||
| sm.factory = vmcpsession.NewDecoratingFactory(cfg.Base) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The comment at lines 132-133 above |
||
|
|
||
| cleanup := func(ctx context.Context) error { | ||
| return optimizerCleanup(ctx) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New()'s doc comment at lines 95-96 still says: "It builds the decorating session factory from cfg, wiring the optimizer and composite tool layers internally." That's no longer accurate — the factory is now just
cfg.Basewith no decorators, and the optimizer is surfaced solely viasm.optimizerFactory/OptimizerFactory()for the Serve layer to consume. Worth rewording.