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

Run task rescheduler in background #3038

Merged
merged 4 commits into from
Jun 30, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Jun 29, 2022

What changed?

  • Make task rescheduler has its own goroutine for rescheduling and run in background.

Why?

  • Currently task rescheduling needs to be explicitly triggered and the trigging is done periodically. This create unnecessary timer/load when there's nothing to reschedule. It also means the task backoff period calculated won't be respected since rescheduling is periodic.
  • In multi-cursor implementation, we need to handle the case where a timer task is loaded but not ready for process. In that case, we can directly send the task to rescheduler. But this approach can't work if rescheduling is periodic as that will greatly increase task latency.

How did you test it?

  • Added new test

Potential risks

  • Rescheduler stop working in existing queue impl

Is hotfix candidate?

  • No.

@yycptt yycptt requested a review from wxing1292 June 29, 2022 23:25
@yycptt yycptt requested a review from a team as a code owner June 29, 2022 23:25
@yycptt yycptt requested review from yux0 and removed request for wxing1292 June 30, 2022 00:58
@yycptt yycptt merged commit 1b330e1 into temporalio:master Jun 30, 2022
@yycptt yycptt deleted the background-task-rescheduler branch June 30, 2022 18:12
yycptt added a commit that referenced this pull request Aug 10, 2022
yycptt added a commit that referenced this pull request Aug 12, 2022
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.

None yet

2 participants