Azure-sdk-for-js: Eventhub subscription receives empty messages after having lost connection.

Created on 10 Nov 2020  路  3Comments  路  Source: Azure/azure-sdk-for-js

  • Package Name: @azure/event-hubs
  • Package Version: 5.3.0
  • Operating system: MacOS
  • nodejs v10

Describe the bug
When losing connection while being subscribed to messages on an event-hub, I'm receiving a, what seems to be infinite, loop of empty messages in the processEvents handler. There is no delay between the messages.

To Reproduce
Steps to reproduce the behavior:

  1. Download and setup the example defined here: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/eventhub/event-hubs/samples/javascript/receiveEvents.js
  1. Add a console.log or debugger in the very top of the processEvents handler. (Line 38)
  2. Remove the part where the connection is automatically closed after a delay. (Line 58 to 62).
  3. Run the script.
  4. Disconnect from the internet.
  5. Wait +/-2 minutes.
  6. Watch an infinite loop of processEvents being called.

(I don't think it's required to have any events in the event hub queue.)

Expected behavior
I would expect only a processError event to be handled. Maybe at most one processEvent to receive part of a batch before having lost the connection, but not an infinite loop. Certainly not without any delay in between.

Client Event Hubs bug customer-reported duplicate

All 3 comments

@Ward6548 Thanks for reporting this issue! I believe this is a duplicate of #12278.

We've merged a fix for this in #12280 and expect to publish version 5.3.1 with this fix included this week. If you want to test this change before it's been published, you can install the nightly build of the event hubs package by running npm install @azure/event-hubs@dev.

I'll post back here once 5.3.1 has been published to npm!

I've tested the nightly build and it works as expected. Looking forward to the official release. Thank you!

@Ward6548 glad to hear it!

We have just published @azure/event-hubs 5.3.1 which includes this fix.
I'm closing this issue, but please feel free to open a new issue or post here if you still encounter this issue after updating.

Was this page helpful?
0 / 5 - 0 ratings