azure-sdk-for-js: [Event hub][Error]New receiver 'nil' with higher epoch of '0' is created hence current receiver 'nil' with epoch '0' is getting disconnected
- Package Name: @azure/event-hubs
- Package Version: 5.5.1
- Operating system:
- nodejs
- version: v14.15.4
- browser
- name/version:
- typescript
- version: 3.7.3
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
Currently we run 8 instances of our application.We are regularly seeing below errors in processError
method. We know the reason of it being ownershipLost
as we have the same number of messages of ownershipLost
and MessagingError
at the same point of time.
MessagingError: New receiver 'nil' with higher epoch of '0' is created hence current receiver 'nil' with epoch '0' is getting disconnected. If you are recreating the receiver, make sure a higher epoch is used. TrackingId:cb4ef8780002f9180003aaad60d145bb_G25_B17, SystemTracker:iot-prd01-evhns:eventhub:iot-prd01-evh~20479|iot-prd01-devices-events-configuration-service-cg, Timestamp:2021-06-22T02:07:34}\"}
We have some questions:
-
Are the above errors due to load balancing done by Azure Event hub sdk? If yes, is load balancing an ongoing process even if none of our services restarted i.e. is the ownership of partitions keep changing even if every application instance is running 24*7. As per, this line it seems load balancing is an ongoing process and the ownership keeps on changing from time to time and our logs also suggest that seeing the amount of error[Ownership] logs we get frequently. Please confirm.
-
Is
processInitialize
method called each time the ownership is transferred from one application instance to other? As per our logs, we never received the processInitialize call after theMessagingError or OwnershipLost
error log received. As per this line it should have been called.
To Reproduce Steps to reproduce the behavior:
- Run multiple instance of your application with Event hub consumer.
Expected behavior processInitialize should be called if ownership is changed between instance of application.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 24 (11 by maintainers)
Hi all, I also have this error that happens very often in 2 environments
The error is:
how can we solve this?