Skip to content
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

Rewrite async workflow queue provider component #5648

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented Feb 8, 2024

What changed?
Rewrite async workflow queue provider component

Why?
The old design doesn't support our use case

How did you test it?
unit tests

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Feb 8, 2024

Pull Request Test Coverage Report for Build 018d8697-c5ff-465f-9604-883b9cf9cf15

  • -14 of 147 (90.48%) changed or added relevant lines in 9 files are covered.
  • 69 unchanged lines in 13 files lost coverage.
  • Overall coverage increased (+0.03%) to 62.684%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cmd/server/cadence/server.go 0 1 0.0%
common/asyncworkflow/queue/provider.go 20 22 90.91%
common/asyncworkflow/queue/kafka/queue.go 40 45 88.89%
service/frontend/api/producer_manager.go 42 48 87.5%
Files with Coverage Reduction New Missed Lines %
common/peerprovider/ringpopprovider/config.go 2 81.58%
common/persistence/historyManager.go 2 66.67%
common/task/fifo_task_scheduler.go 2 87.63%
common/task/parallel_task_processor.go 2 93.06%
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
common/util.go 2 91.69%
service/history/task/transfer_standby_task_executor.go 2 86.6%
service/matching/taskListManager.go 2 80.96%
common/persistence/statsComputer.go 3 94.64%
service/history/task/fetcher.go 4 85.05%
Totals Coverage Status
Change from base Build 018d8331-39b4-4cf4-9d9b-b3f43dea0e69: 0.03%
Covered Lines: 92222
Relevant Lines: 147121

💛 - Coveralls


func (d *decoderImpl) Decode(out any) error {
if d.blob.GetEncodingType() != types.EncodingTypeJSON {
return fmt.Errorf("unsupported encoding type %v", d.blob.GetEncodingType())
Copy link
Member

Choose a reason for hiding this comment

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

let's mention supported encoding types in the error message

service/frontend/api/producer_manager.go Outdated Show resolved Hide resolved
// PutIfNotExist is thread safe, and will either return the value that was already in the cache or the value we just created
// another thread might have inserted a value between the Get and PutIfNotExist, but that is ok
// it should never return an error as we do not use Pin
val, err = q.producerCache.PutIfNotExist(queueID, producer)
Copy link
Member

Choose a reason for hiding this comment

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

side comment: a better semantic for this would be PutIfNotExist(key string, valueCreator func() any) so we could avoid the potential duplicate initialization problem

Copy link
Member Author

Choose a reason for hiding this comment

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

that requires rewriting cache implementation, will not do it in this pr

@Shaddoll Shaddoll merged commit 9527a24 into cadence-workflow:master Feb 8, 2024
16 checks passed
@Shaddoll Shaddoll deleted the async-provider branch February 8, 2024 04:41
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.

3 participants