Skip to content

Don't add results to finalResults once promise was notified#13196

Merged
normanmaurer merged 1 commit into4.1from
memory_leak
Feb 7, 2023
Merged

Don't add results to finalResults once promise was notified#13196
normanmaurer merged 1 commit into4.1from
memory_leak

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

@normanmaurer normanmaurer commented Feb 6, 2023

Motivation:

We need to ensure we release the results if we dont end up transfering the ownership. In some cases we could have ended up to adding more results to the List without be sure that these will ever be released at all.

Modifications:

Only add results as long as we did not notify yet. Otherwise release these.

Result:

No more memory leak possible even if promise is already completed

Comment thread resolver-dns/src/main/java/io/netty/resolver/dns/DnsResolveContext.java Outdated
@normanmaurer normanmaurer added this to the 4.1.88.Final milestone Feb 6, 2023
@normanmaurer
Copy link
Copy Markdown
Member Author

Actually there is something else wrong here. Let me work on this

Motivation:

We need to ensure we release the results if we dont end up transfering the ownership. In some cases we could have ended up to adding more results to the List without be sure that these will ever be released at all.

Modifications:

Only add results as long as we did not notify yet. Otherwise release these.

Result:

No more memory leak possible even if promise is already completed
@normanmaurer normanmaurer changed the title Release results if ownership is not transfered to Promise Don't add results to finalResults once promise was notified Feb 6, 2023
@normanmaurer normanmaurer merged commit 6198dab into 4.1 Feb 7, 2023
@normanmaurer normanmaurer deleted the memory_leak branch February 7, 2023 15:32
normanmaurer added a commit that referenced this pull request Feb 7, 2023
Motivation:

We need to ensure we release the results if we dont end up transfering the ownership. In some cases we could have ended up to adding more results to the List without be sure that these will ever be released at all.

Modifications:

Only add results as long as we did not notify yet. Otherwise release these.

Result:

No more memory leak possible even if promise is already completed
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