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

Enforce context timeout in matching AddTask #4048

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

yycptt
Copy link
Contributor

@yycptt yycptt commented Mar 10, 2021

What changed?

  • Enforce context timeout for AddTask operation in matching
  • Add logs when some matching operations failed

Why?
One path in AddTask in matching requires persist the task to DB, and may be retried for up to 30 second regardless what context timeout in specified for the AddTask call.

On history side, the specified context timeout is only 3s, after will retry the AddTask operation if failed. This mismatch of retry policy will cause matching to persist much more tasks than needed, and made the situation worse when service busy error happens.

By enforcing the context timeout when persisting tasks, we removed mismatching in two different retry policies and can reduce the number of tasks persisted by matching.

How did you test it?
Unit test

Potential risks
More matching Add task error may happen as now context timeout is enforced.

@yycptt yycptt requested review from yux0 and a team March 10, 2021 20:59
@coveralls
Copy link

coveralls commented Mar 10, 2021

Coverage Status

Coverage decreased (-0.04%) to 66.798% when pulling 811243b on yycptt:fix-matching-retry into 2458bdb on uber:master.

@yycptt yycptt merged commit 86e6c7c into cadence-workflow:master Mar 16, 2021
@yycptt yycptt deleted the fix-matching-retry branch March 16, 2021 04:52
yux0 pushed a commit to yux0/cadence that referenced this pull request May 4, 2021
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