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

update startedEventId in buffered events #392

Merged
merged 4 commits into from
Oct 26, 2017

Conversation

yiminc-zz
Copy link

update startedEventId in buffered events.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 96474b1 on yiminc:update_startedEventId_in_history into ** on uber:master**.

case workflow.EventTypeActivityTaskStarted:
// need to update startedEventId in mutableState if it is still there
scheduledEventId := event.ActivityTaskStartedEventAttributes.GetScheduledEventId()
if ai, ok := e.GetActivityInfo(scheduledEventId); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you check if creating 2 updates in the same transaction for same activityInfo will work?

e.updateActivityInfos = append(e.updateActivityInfos, ai)
}
// update subsequent buffered events in this batch that have reference to the startedEventId
for j := i + 1; j < len(newCommittedEvents); j++ {
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 we should be able to update all events in a single pass. I'm not sure this N^2 algorithm is needed here.

for j := i + 1; j < len(newCommittedEvents); j++ {
closeEvent := newCommittedEvents[j]
switch closeEvent.GetEventType() {
case workflow.EventTypeChildWorkflowExecutionCompleted:
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 there is one more event 'StartChildWorkflowExecutionFailedEvent'

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling eee50fe on yiminc:update_startedEventId_in_history into ** on uber:master**.

@yiminc-zz yiminc-zz merged commit d0bd7ba into uber:master Oct 26, 2017
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.

4 participants