Skip to content

Commit 93a35f8

Browse files
committed
remove fastForwardNotifier from context provider
1 parent acd5af3 commit 93a35f8

4 files changed

Lines changed: 131 additions & 14 deletions

File tree

common/testing/mocksdk/client_mock.go

Lines changed: 129 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

service/history/fx.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import (
4747
"go.temporal.io/server/service/history/consts"
4848
"go.temporal.io/server/service/history/events"
4949
"go.temporal.io/server/service/history/hsm"
50-
"go.temporal.io/server/service/history/notification"
5150
"go.temporal.io/server/service/history/replication"
5251
"go.temporal.io/server/service/history/shard"
5352
"go.temporal.io/server/service/history/workflow"
@@ -93,7 +92,6 @@ var Module = fx.Options(
9392
service.PersistenceLazyLoadedServiceResolverModule,
9493
fx.Provide(ServiceResolverProvider),
9594
fx.Provide(EventNotifierProvider),
96-
fx.Provide(TimeSkippingFastForwardNotifierProvider),
9795
fx.Provide(HistoryEngineFactoryProvider),
9896
fx.Provide(HandlerProvider),
9997
fx.Provide(HistoryServiceServerProvider),
@@ -484,12 +482,6 @@ func EventNotifierProvider(
484482
)
485483
}
486484

487-
func TimeSkippingFastForwardNotifierProvider(
488-
serviceConfig *configs.Config,
489-
) notification.TimeSkippingFastForwardNotifier {
490-
return notification.NewTimeSkippingFastForwardNotifier(serviceConfig.GetShardID)
491-
}
492-
493485
func ServiceLifetimeHooks(lc fx.Lifecycle, svc *Service) {
494486
lc.Append(fx.StartStopHook(svc.Start, svc.Stop))
495487
}

service/history/history_engine.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func NewEngineWithShardContext(
161161
matchingClient matchingservice.MatchingServiceClient,
162162
sdkClientFactory sdk.ClientFactory,
163163
eventNotifier events.Notifier,
164-
fastForwardNotifier notification.TimeSkippingFastForwardNotifier,
165164
config *configs.Config,
166165
versionCache worker_versioning.VersionMembershipAndReactivationStatusCache,
167166
workerDeploymentClient workerdeployment.Client,
@@ -218,7 +217,7 @@ func NewEngineWithShardContext(
218217
throttledLogger: log.With(shard.GetThrottledLogger(), tag.ComponentHistoryEngine),
219218
metricsHandler: shard.GetMetricsHandler(),
220219
eventNotifier: eventNotifier,
221-
fastForwardNotifier: fastForwardNotifier,
220+
fastForwardNotifier: notification.NewTimeSkippingFastForwardNotifier(config.GetShardID),
222221
config: config,
223222
sdkClientFactory: sdkClientFactory,
224223
matchingClient: matchingClient,
@@ -895,7 +894,7 @@ func (e *historyEngineImpl) NotifyFastForwardUpdate(
895894
fastforwardNotification *notification.TimeSkippingFastForwardNotification,
896895
) {
897896
if e.fastForwardNotifier == nil {
898-
// Always injected in production via fx; a nil here means a misconfigured engine.
897+
// Always set by NewEngineWithShardContext; a nil here means a hand-built engine.
899898
// Fast-forward notification is best-effort (waiters re-poll on timeout), so log and
900899
// skip rather than panic.
901900
e.logger.Warn("fastForwardNotifier is not configured; skipping fast-forward notification",

service/history/history_engine_factory.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import (
1717
"go.temporal.io/server/service/history/configs"
1818
"go.temporal.io/server/service/history/events"
1919
historyi "go.temporal.io/server/service/history/interfaces"
20-
"go.temporal.io/server/service/history/notification"
2120
"go.temporal.io/server/service/history/replication"
2221
"go.temporal.io/server/service/history/tasks"
2322
"go.temporal.io/server/service/history/workflow"
@@ -34,7 +33,6 @@ type (
3433
MatchingClient resource.MatchingClient
3534
SdkClientFactory sdk.ClientFactory
3635
EventNotifier events.Notifier
37-
TimeSkippingFastForwardNotifier notification.TimeSkippingFastForwardNotifier
3836
Config *configs.Config
3937
RawMatchingClient resource.MatchingRawClient
4038
WorkflowCache wcache.Cache
@@ -73,7 +71,6 @@ func (f *historyEngineFactory) CreateEngine(
7371
f.MatchingClient,
7472
f.SdkClientFactory,
7573
f.EventNotifier,
76-
f.TimeSkippingFastForwardNotifier,
7774
f.Config,
7875
f.VersionMembershipCache,
7976
f.WorkerDeploymentClient,

0 commit comments

Comments
 (0)