Skip to content
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

[core-amqp] set the max listener limit to 1000 for sender and receiver #20088

Merged
merged 3 commits into from
Feb 2, 2022

Conversation

jeremymeng
Copy link
Member

NodeJS would issue warning if the number of disconnected listeners on an event
emitter exceeds 10. When many sessions on a connection are closed but the
removal of the listener hasn't caught up, we will see this warning because the
default limit of 10 in NodeJS is too low. The disconnected listeners DO get
removed eventually in our code.

We already do this for senders created in Service Bus. This PR increase the
limit to 1000 for senders and receivers created off
ConnectionContextBase.connection so that the limites apply to both Service Bus
and Event Hubs.

Packages impacted by this PR

core-amqp, service-bus, event-hub

Issues associated with this PR

#12161

Describe the problem that is addressed by this PR

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Are there test cases added in this PR? (If not, why?)

no functionality changes. covered by stress tests

NodeJS would issue warning if the number of disconnected listeners on an event
emitter exceeds 10. When many sessions on a connection are closed but the
removal of the listener hasn't caught up, we will see this warning because the
default limit of 10 in NodeJS is too low. The disconnected listeners DO get
removed eventually in our code.

We already do this for senders created in Service Bus. This PR increase the
limit to 1000 for senders and receivers created off
`ConnectionContextBase.connection` so that the limites apply to both Service Bus
and Event Hubs.
@ghost ghost added the Azure.Core label Jan 26, 2022
@jeremymeng jeremymeng marked this pull request as ready for review February 1, 2022 19:15
@jeremymeng
Copy link
Member Author

test failure due to known sanitizer issue.

*/
async createSender(options?: CreateSenderOptions): Promise<Sender> {
const sender = await super.createSender(options);
sender.setMaxListeners(1000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this 1000 be put in a variable instead so it is easier to update it everywhere if there is a need to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted

Copy link
Member

@deyaaeldeen deyaaeldeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change makes sense.

@ramya-rao-a
Copy link
Contributor

We already do this for senders created in Service Bus

Should we also update Service Bus to remove the setting of this limit in this PR now that this comes from core-amqp?

@jeremymeng
Copy link
Member Author

Should we also update Service Bus to remove the setting of this limit in this PR now that this comes from core-amqp?

Yes! I was going to do that once you all are fine with this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants