Skip to content

Refactor history queue factory #6907

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

Merged
merged 1 commit into from
May 13, 2025
Merged

Conversation

Shaddoll
Copy link
Member

What changed?
Refactor history queue factory

Why?
To unify some methods for creating history queues, which will make it a lot easier to introduce queuev2.

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

)
for _, factory := range queueFactories {
historyEngImpl.queueProcessors[factory.Category()] = factory.CreateQueue(
shard,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shard.SetEngine() is called later in this function but the queue factory is calling shard.GetEngine(). Let's make sure the dependencies are clear and future proof.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The queue processors are depending on shard context and history engine. History engine is depending on shard context.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is not clear is the dependency between history engine and shard context, but it's unrelated to this PR.

@@ -204,14 +215,16 @@ func (e *historyEngineImpl) generateGracefulFailoverTasksForDomainUpdateCallback

func (e *historyEngineImpl) lockTaskProcessingForDomainUpdate() {
e.logger.Debug("Locking processing for domain update")
e.txProcessor.LockTaskProcessing()
e.timerProcessor.LockTaskProcessing()
for _, processor := range e.queueProcessors {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in the scope of this PR but let's see if we really need to lock task processing for these domain change callbacks.

@Shaddoll Shaddoll merged commit 23038d4 into cadence-workflow:master May 13, 2025
17 checks passed
@Shaddoll Shaddoll deleted the factory branch May 13, 2025 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants