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

Deprecate timer builder #2725

Merged
merged 12 commits into from
Oct 31, 2019
Merged

Deprecate timer builder #2725

merged 12 commits into from
Oct 31, 2019

Conversation

wxing1292
Copy link
Contributor

@wxing1292 wxing1292 commented Oct 28, 2019

  • Deprecate timer builder
  • Rename TimerSequenceID to timerKey
  • Do not expose user timer task / activity timer task vars
  • Rewrite time active processing logic UT

@wxing1292 wxing1292 requested review from yux0 and yycptt October 28, 2019 03:31
* Rename TimerSequenceID to timerKey
* Do not expose user timer task / activity timer task vars

TODO:
* Rename DecisionTimeoutValue to DecisionStartToCloseTimeout
* DecisionTimeout in decisionInfo is always DecisionTimeoutValue or 0?
* Rewrite timer active processing logic
* Mutable state should have the ability to tell whether a write to DB can be omitted
@coveralls
Copy link

coveralls commented Oct 28, 2019

Coverage Status

Coverage decreased (-0.4%) to 66.41% when pulling 230b2c1 on deprecate-timer-builder into b1c0886 on master.

@wxing1292 wxing1292 merged commit a0058ff into master Oct 31, 2019
@wxing1292 wxing1292 deleted the deprecate-timer-builder branch October 31, 2019 17:28
if err != nil {
return nil, err
}
targetDomainID = targetDomainEntry.GetInfo().ID
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason to override domain in this case? Can you put a comment in the code?

}

func (r *mutableStateTaskGeneratorImpl) getTimerBuilder(now time.Time) *timerBuilder {
func (r *mutableStateTaskGeneratorImpl) getTimerSequence(now time.Time) timerSequence {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way that this can belong to mutable state?


// timerKey - Visibility timer stamp + Sequence Number.
timerKey struct {
VisibilityTimestamp time.Time
Copy link
Contributor

Choose a reason for hiding this comment

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

You must have got used to this. But it's not very clear to me what visibility timestamp means for a timer. Worth putting a comment there.

Copy link
Contributor

Choose a reason for hiding this comment

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

My guess is it's the timestamp the timer is supposed to fire?

@@ -228,30 +228,33 @@ func (t *timerQueueStandbyProcessorImpl) process(
}
}

func (t *timerQueueStandbyProcessorImpl) processExpiredUserTimer(
func (t *timerQueueStandbyProcessorImpl) processUserTimerTimeout(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think processExpiredUserTimer is a better name, since you still check timerSequence.isExpired inside.

for _, timerSequenceID := range timerSequence.loadAndSortUserTimers() {
_, ok := mutableState.GetUserTimerInfoByEventID(timerSequenceID.eventID)
if !ok {
errString := fmt.Sprintf("failed to find in user timer event ID: %v", timerSequenceID.eventID)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove "memory"? :)

timerTaskStatusCreatedScheduleToClose
timerTaskStatusCreatedHeartbeat
)

type (
// timerSequenceID
timerSequenceID struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

This name is a little weird to me.

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.

5 participants