-
Notifications
You must be signed in to change notification settings - Fork 174
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
Improved failure handling fully remove multierr.Errors system test for testing connection errors bugfix issue 350 View.Get fails on reconnecting view bugfix processor freeze on error (334) #361
Conversation
db3a434
to
3d492fb
Compare
@@ -425,6 +430,12 @@ func (v *View) Evict(key string) error { | |||
|
|||
// Recovered returns true when the view has caught up with events from kafka. | |||
func (v *View) Recovered() bool { | |||
// no partitions --> never recover | |||
// Otherwise we might mask errors of initializing the view | |||
if len(v.partitions) == 0 { |
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.
possible bugfix: if views were empty due to errors, they might have appeared to be recovered.
@@ -331,6 +331,11 @@ func (v *View) Topic() string { | |||
// Get can be called by multiple goroutines concurrently. | |||
// Get can only be called after Recovered returns true. | |||
func (v *View) Get(key string) (interface{}, error) { | |||
|
|||
if v.state.IsState(State(ViewStateIdle)) || v.state.IsState(State(ViewStateInitializing)) { |
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.
functional change: block attempts to read if the view isn't ready yet.
@@ -711,7 +673,7 @@ func (p *PartitionTable) IteratorWithRange(start []byte, limit []byte) (storage. | |||
|
|||
func (p *PartitionTable) readyToRead() error { | |||
pstate := p.CurrentState() | |||
if pstate != PartitionRunning { | |||
if pstate < PartitionConnecting { |
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 actually fixes bug #350
select { | ||
case <-ctx.Done(): | ||
return | ||
case <-sessionCtx.Done(): |
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.
Either context.Done will break the loop. Is this correct or do you need to wait for both?
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.
yeah, because sessionCtx
recreated on each loop iteration and starts the error-reading go-routine again. But we need to stop this go-routine on rebalance (where there is no error), otherwise we end up with multiple of those routines. The parent context (ctx) however will not be cancelled yet, because there was not an error yet.
fully remove multierr.Errors system test for testing connection errors bugfix issue 350 View.Get fails on reconnecting view bugfix processor freeze on error (334)
3d492fb
to
6334df4
Compare
Improve system tests
improve error handling
multierr.Error
cosequentlyerrs.Collect
indefer
ed functions)