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

MaxListenersExceededWarning: Possible EventEmitter memory leak detected #51597

Closed
bpasero opened this issue Jun 11, 2018 · 8 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented Jun 11, 2018

Steps:

  • macOS
  • open quick open
  • type a "/"
  • continue typing some characters
  • eventually you get this:

image

@roblourens @chrmarti could this possibly come from the feature were we try to stat the path if it is absolute? Because I had to fix #42726 I lifted this check into the openFileHandler, so I would not need this kind of functionality anymore in the search service. I think we should probably remove it from there as it imho only makes sense in the context of quick open?

@bpasero bpasero added the search Search widget and operation issues label Jun 11, 2018
@roblourens
Copy link
Member

I think this is from the process.on('exit' handlers in fileSearch.ts, new ones are added before the previous ones are removed when typing quickly, but it all balances out in the end. I can't get it to repro in 1.24 so I'll see what's changed.

It would be good to remove that from the search service if we can.

@roblourens roblourens added the bug Issue identified by VS Code Team member as probable bug label Jun 11, 2018
@chrmarti
Copy link
Contributor

I added this listener to make sure ripgrep is killed when the search process goes down after reports of hanging rg processes. Quick typing in QuickOpen should end up in the cache, where do you see ripgrep spawned by each keystroke?

@bpasero
Copy link
Member Author

bpasero commented Jun 12, 2018

@chrmarti #51597 (comment)

@roblourens roblourens added this to the June 2018 milestone Jun 12, 2018
@roblourens
Copy link
Member

If you type with / first, then it skips the cache, because it has to check the filesystem for every keypress. If that file doesn't exist then it runs rg.

@bpasero
Copy link
Member Author

bpasero commented Jun 13, 2018

I would just remove that feature from search.

@chrmarti
Copy link
Contributor

Doing it all on the search side would be more efficient than doing part of it in the openFileHandler handler because you then call the extension host only once.

Maybe the check for an absolute file could be moved before the cache, so the cache can then be used if there was not hit.

@bpasero
Copy link
Member Author

bpasero commented Jun 13, 2018

@chrmarti maybe more efficient, but does it make sense that the search service behaves like that? I think its contract is to search in the scope of the workspace and all opened files but not for the file path if it happens to be a file on disk and it is passed into the service. Besides, what does it mean for remote scenarios that a user puts in a remote file path, would we then also ask each remote file provider if the file exists?

roblourens added a commit that referenced this issue Jun 24, 2018
@roblourens
Copy link
Member

I agree that this makes more sense to handle outside of the search service. Opened a PR.

roblourens added a commit that referenced this issue Jun 25, 2018
roblourens added a commit that referenced this issue Jun 25, 2018
Fix #51597 - move searching with absolute path queries out of search service and into openFileHandler
@bpasero bpasero added the verified Verification succeeded label Jun 26, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug search Search widget and operation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants