-
Notifications
You must be signed in to change notification settings - Fork 800
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
Deprecate timer builder #2725
Conversation
wxing1292
commented
Oct 28, 2019
•
edited
Loading
edited
- Deprecate timer builder
- Rename TimerSequenceID to timerKey
- Do not expose user timer task / activity timer task vars
- Rewrite time active processing logic UT
* 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
1dfb05e
to
00036ba
Compare
99ffd2d
to
12ea40c
Compare
if err != nil { | ||
return nil, err | ||
} | ||
targetDomainID = targetDomainEntry.GetInfo().ID |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.