Closed yaziine closed 5 years ago
There are panics that should be fixed.
The first one is in the setup method when trying to retrieve the MaxRetryInterval configuration when c.config is nil. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L91
setup
MaxRetryInterval
c.config
The second one is involved by fixing the first one: calling setup when c.config is nil won't create the c.retryStrategy. This ends with panic when using it in retry.StartWithCancel. We should create the config before calling setup in the Serve method. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L213
c.retryStrategy
The third one is the panic("unreachable"), when sending SIGINT to the consumer, this piece of code is reachable. We should return a nil Message to close the consumer. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L242
panic("unreachable")
There are panics that should be fixed.
The first one is in the
setup
method when trying to retrieve theMaxRetryInterval
configuration whenc.config
is nil. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L91The second one is involved by fixing the first one: calling
setup
whenc.config
is nil won't create thec.retryStrategy
. This ends with panic when using it in retry.StartWithCancel. We should create the config before calling setup in the Serve method. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L213The third one is the
panic("unreachable")
, when sending SIGINT to the consumer, this piece of code is reachable. We should return a nil Message to close the consumer. https://github.com/heetch/felice/blob/4aa9633649f00575adc667afb14331bebd65f760/consumer/consumer.go#L242