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

Fix a memory leak on listener #10294

Merged
merged 7 commits into from
Jun 17, 2020
Merged

Fix a memory leak on listener #10294

merged 7 commits into from
Jun 17, 2020

Conversation

aaomidi
Copy link
Contributor

@aaomidi aaomidi commented May 7, 2020

This method was ending up creating a new instance of ConnectionProfile, which ended up listening onto an event.

Before this change, if you dragged a server from the OE around ADS you would end up with over 1000 instances of ProviderConnectionInfo within a second.

I think this is how memoize was meant to be used, please let me know if this isn't how it was meant to be used. If not I can make my own caching table instead.

@coveralls
Copy link

coveralls commented May 7, 2020

Coverage Status

Coverage decreased (-0.1%) to 34.913% when pulling ab691e2 on amir/connectionProfile/leakFix into fb4e400 on main.

@aaomidi
Copy link
Contributor Author

aaomidi commented May 7, 2020

I have a hunch that the test itself was incorrect here, but I'm not entirely sure. If anyone is familiar with this space, please take a look at the changes I've made to the tests.

@aaomidi aaomidi requested a review from anthonydresser May 7, 2020 20:41
@@ -603,7 +603,7 @@ suite('ConnectionConfig', () => {
providerName: 'MSSQL',
options: {},
saveProfile: true,
id: 'server3',
id: 'server3-2',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is correct? The ids should be different but currently your update changes them to both be the same.

What was the error you were seeing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the tests were failing since this wasn't throwing.

Before, instead of comparing the IDs we were comparing the getConnectionInfoId(), which is somewhat different.

Hmm. I'll see if I can do this without converting to a ConnectionProfile

@aaomidi aaomidi requested a review from Charles-Gagnon May 7, 2020 22:50
@aaomidi
Copy link
Contributor Author

aaomidi commented May 7, 2020

The PR validation failure is because github had a short downtime.

@adsbot adsbot bot added the Stale PR label May 14, 2020
@kburtram kburtram changed the base branch from master to main June 15, 2020 06:21
@adsbot adsbot bot removed the Stale PR label Jun 15, 2020
@aaomidi aaomidi merged commit 21fd8b2 into main Jun 17, 2020
@aaomidi aaomidi deleted the amir/connectionProfile/leakFix branch June 17, 2020 02:36
ktech99 pushed a commit that referenced this pull request Aug 23, 2020
* Fix leak

* We don't need the full connection profiles for drag drop control

* Remove unused code

* Change test definition

* Change test definition

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

Successfully merging this pull request may close these issues.

3 participants