-
Notifications
You must be signed in to change notification settings - Fork 869
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Change execution scavenger to call admin delete #3526
Changes from 2 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 |
---|---|---|
|
@@ -186,7 +186,9 @@ func NewService( | |
perNamespaceWorkerManager: perNamespaceWorkerManager, | ||
workerFactory: workerFactory, | ||
} | ||
s.initScanner() | ||
if err := s.initScanner(); err != nil { | ||
return nil, err | ||
} | ||
return s, nil | ||
} | ||
|
||
|
@@ -468,7 +470,12 @@ func (s *Service) startBatcher() { | |
} | ||
} | ||
|
||
func (s *Service) initScanner() { | ||
func (s *Service) initScanner() error { | ||
currentCluster := s.clusterMetadata.GetCurrentClusterName() | ||
adminClient, err := s.clientBean.GetRemoteAdminClient(currentCluster) | ||
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. I think we should add a GetAdminClient to ClientBean to keep it similar to Get[Remote]FrontendClient, since frontend and admin clients work the same way. also, I noticed Get/SetFrontendClient in clientBean.go don't do proper locking 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. I plan to include this in the next available patch. So I created an issue to track here: #3532. 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. Do you plan to fix locking bug in this PR? 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. No. I don't see caller in those setters. I will remove them in another PR. |
||
if err != nil { | ||
return err | ||
} | ||
s.scanner = scanner.New( | ||
s.logger, | ||
s.config.ScannerCfg, | ||
|
@@ -477,9 +484,11 @@ func (s *Service) initScanner() { | |
s.executionManager, | ||
s.taskManager, | ||
s.historyClient, | ||
adminClient, | ||
s.namespaceRegistry, | ||
s.workerFactory, | ||
) | ||
return nil | ||
} | ||
|
||
func (s *Service) startScanner() { | ||
|
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.
hmmm, looks like we still need a way to clean up in this case. Admin DeleteWorkflowExecution should probably take in namespaceID instead of namespaceName?
Maybe create a task for this?
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.
#3536