This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
MIT License
2.33k
stars
1.97k
forks
source link
[QUERY] What happens when "partitionProcessor.processEvent" throws an exception? How can I stop processEvent retries when the client gets closed? #39986
Query/Question
I'm trying to follow the flow of an exception in partitionProcessor.processEvent, but the code comments and documentation are at best confusing or even contradict each other (JS calls out that the method is called, dotNet says it isn't, java docs don't mention much about this method). It's also unclear what happens after this method is invoked (recovery, partition lost, ...)
When an error is raised from processEvent, the partition processor will be closed with the CloseReason.LOST_PARTITION_OWNERSHIP (even though no doc mentions this as a root cause)? So another process picks up the processing from the last checkpoint, including this message? What is the impact of "shouldRethrow" on "user code exceptions". How is it different from the partition close that always happens on every error (partitionProcessor.close)? Throwing an error in the subscribe's errorConsumer has no effect, unless there is some onErrorDropped hook somewhere?
If I want to retry specific errors like network issues indefinitely, I must do this in the processEvent callback without throwing? But if someone closes the client, how can I detect this and stop the infinite retry? What mechanisms are available within processEvent to detect a shutdown?
Why is this not a Bug or a feature Request?
It's a question.
Setup (please complete the following information if applicable):
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
Query/Question I'm trying to follow the flow of an exception in
partitionProcessor.processEvent
, but the code comments and documentation are at best confusing or even contradict each other (JS calls out that the method is called, dotNet says it isn't, java docs don't mention much about this method). It's also unclear what happens after this method is invoked (recovery, partition lost, ...)Now the questions:
processError
is NOT invoked for "user code threw an exception in processEvent callback" (https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/eventhubs/azure-messaging-eventhubs/src/main/java/com/azure/messaging/eventhubs/PartitionPumpManager.java#L372C19-L372C72), given theif (!(throwable instanceof PartitionProcessorException)) {
guardprocessEvent
, the partition processor will be closed with the CloseReason.LOST_PARTITION_OWNERSHIP (even though no doc mentions this as a root cause)? So another process picks up the processing from the last checkpoint, including this message? What is the impact of "shouldRethrow" on "user code exceptions". How is it different from the partition close that always happens on every error (partitionProcessor.close)? Throwing an error in the subscribe's errorConsumer has no effect, unless there is someonErrorDropped
hook somewhere?Why is this not a Bug or a feature Request? It's a question.
Setup (please complete the following information if applicable):
Library/Libraries: com.azure:azure-messaging-eventhubs:5.18.3
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report