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
[azeventhubs] Calling Run
again on an already errored Processor
causes a panic
#22785
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @jfggdl. |
A bit more context on the why I even want to restart the processor: I implemented a AWS DynamoDB checkpoint store, and the calls can be throttled for some time until autoscaling kicks in. CheckpointStore failures will propagate back to the processor causing it to exit. But those errors are recoverable, as the checkpoint store will be able to recover. I know that the Processor could also fail on non-recoverable errors, such as an incorrect ConsumerGroup for instance. So the crux of what I am trying to solve here is really be able to restart the processor on CheckpointStore errors, if you can think of any proper handling of this. |
@PaulBernier, I'm looking at this to see how difficult it would be as it doesn't seem unreasonable at all. Now, for any CheckpointStore, you'll probably just want to add a more forgiving retry policy. It's not really something you need or want to do at the Event Hubs level. Does the AWS DynamoDB client have a configurable retry policy? In Azure we have a RetryPolicy that can get passed into our clients: azure-sdk-for-go/sdk/azcore/policy/policy.go Lines 87 to 88 in 03baedf
|
Yes AWS DynamoDB client have retries, but sometimes it can take more time than we would like to adjust. I agreed with the direction of making the checkpointing more robust. But I still want to have a fail-safe approach, and restarting the Processor would be the last resort mean to revive the consumption process. For now I am implementing that last resort restart by recreating a new Processor, and that's fine, just more verbose/tricky than my ideal Processor restart: for {
if err := processor.Run(processorCtx); err != nil {
r.logger.Error("Processor error", zap.Error(err))
time.Sleep(20 * time.Seconds)
continue
}
break
} The panic I pointed out is the main thing I'd expect to be fixed from this issue, any other improvement would just be a bonus :) |
@PaulBernier, the fix here was just to make the Processor indicate it's single-use only - once stopped, it can't be restarted. It'll return proper errors now, with the release that's coming out next week. |
Bug Report
azure-sdk-for-go/sdk/messaging/azeventhubs/processor.go
Line 290 in aae700f
The text was updated successfully, but these errors were encountered: