-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2023-10-10] [$500] MaxListenersExceededWarning: Possible EventEmitter memory leak detected #26986
Comments
Triggered auto assignment to @garrettmknight ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue."MaxListenersExceededWarning: Possible EventEmitter memory leak detected" warning showing up on dev. What is the root cause of that problem?This is due to the number of keyboard shortcuts being setup exceeding the default number of max listeners. What changes do you think we should make in order to solve the problem?Increase the number of max listeners by setting the EventEmitter's
We can also consider setting the value to be higher than this if required (+5 extra or double the length?) in cases where we try to set up more keyboard shortcuts so the warning does not show up in those instances. Finally, if we don't care about having a limit, we can set it to
What alternative solutions did you explore? (Optional)None. |
ProposalPlease re-state the problem that we are trying to solve in this issue."MaxListenersExceededWarning: Possible EventEmitter memory leak detected" warning showing up on dev. What is the root cause of that problem?The default value of maxEventListeners is 10. We currently have 11 event listeners on general app usage What changes do you think we should make in order to solve the problem?We should increase the ceiling of defaultMaxEventListeners. ...
// Import defaultMaxListeners from events module
import {defaultMaxListeners} from 'events';
// Set defaultMaxListeners
defaultMaxListeners = 20; Let's not set it to What alternative solutions did you explore? (Optional)xx |
@garrettmknight Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@garrettmknight Whoops! This issue is 2 days overdue. Let's get this updated quick! |
I don't have a dev to test this on, but I'll believe @marcaaron. Checking whether it's |
ProposalPlease re-state the problem that we are trying to solve in this issue.MaxListenersExceededWarning: Possible EventEmitter memory leak detected What is the root cause of that problem?We're using What changes do you think we should make in order to solve the problem?The import Events from 'eventemitter3';
const EventEmitter = new Events(); I created a fork and tested, it seemed that everything worked as expected (https://github.com/hungvu193/App/tree/bump-to-ee3). What alternative solutions did you explore? (Optional)N/A |
ProposalPlease re-state the problem that we are trying to solve in this issue.MaxListenersExceededWarning: Possible EventEmitter memory leak detected What is the root cause of that problem?We have a limit of 10 max listener for the events package and we're registering total 11 events which is raising this wanring. What changes do you think we should make in order to solve the problem?Instead of going with global override we can update the maxilistener count using
KeyCommand.eventEmitter.setMaxListener(20) What alternative solutions did you explore? (Optional)Or whenever we're adding a new listener we can check the max and current listener count and increment using a threshold way. Like if we have 15 listeners we can update it to 20 listeners etc so, Just an alternative approach minding that we might add few more listeners in future so that it won't get clogged and no need to change everytime we reach the limit.
|
@garrettmknight if it's external, you forget to apply |
Current assignee @garrettmknight is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
@hungvu193's proposal looks good to me! Let's upgrade! 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @roryabraham, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
hey, I think we found out why this is happening. We're adding a new event listener everytime you access a report, and never removing those. So over time, if you access 10s of reports, it will pass the default limit from the browser. I think we need to hold this a bit |
@danieldoglas are you working on a solution in some other context where I can follow along? |
@garrettmknight, @hungvu193, @roryabraham, @thesahindia Whoops! This issue is 2 days overdue. Let's get this updated quick! |
PR is merged! |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.76-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-10-10. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Summary of payments for this issue:
Upwork job: https://www.upwork.com/en-gb/jobs/~01961f084c190662b2 |
Dropping to weekly while @thesahindia finishes the checklist/submits for payment. |
Just made the request. We don't have to add any test case and we can skip the checklist. We can't call it a regression. |
Sounds good, closing. |
$500 payment approved for @thesahindia based on BZ summary. |
This has been showing for over 2 months on dev. Can we fix it?
Upwork Automation - Do Not Edit
Slack convo if necessary: https://expensify.slack.com/archives/C049HHMV9SM/p1694421370612589
The text was updated successfully, but these errors were encountered: