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

Sync recover #11

Merged
merged 5 commits into from
May 3, 2017
Merged

Sync recover #11

merged 5 commits into from
May 3, 2017

Conversation

db7
Copy link
Collaborator

@db7 db7 commented Apr 27, 2017

waits untils views and partitioned views are ready before processing events of the partitions

@db7 db7 requested review from frairon and SamiHiltunen April 27, 2017 18:03
}

go func() {
ticker := time.NewTicker(delayProxyInterval)
Copy link
Contributor

Choose a reason for hiding this comment

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

for me it's too much nesting here. You could at least check the iterating over the waiters to

func (p *delayProxy) waitersDone() bool {
	for _, r := range p.wait {
		if !r() {
			return false
		}
	}
	return true
}

Then the done can be removed and the check is easier

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually I'd even extract the function doing the loop over the ticker altogether. It's not a closure, so there's no need to define it inline. Then just call the extracted function in a goroutine and it's much clearer

proxy.go Outdated
}
}
if done {
p.consumer.AddGroupPartition(p.partition)
Copy link
Contributor

Choose a reason for hiding this comment

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

missing return here? Otherwise the group partition is added to the consumer on every tick

@@ -379,7 +379,11 @@ func (g *Processor) run() {
}

case *kafka.NOP:
_ = g.pushToPartition(ev.Partition, ev)
if g.graph.joint(ev.Topic) {
_ = g.pushToPartitionView(ev.Topic, ev.Partition, ev)
Copy link
Contributor

Choose a reason for hiding this comment

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

sure we want to ignore the error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

NOP is only used for testing

Copy link
Contributor

Choose a reason for hiding this comment

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

can only occur in unit-test. so it's fine.

@db7 db7 merged commit 35c118f into master May 3, 2017
@db7 db7 deleted the sync-recover branch May 8, 2017 13:56
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.

2 participants