Skip to content

Fix memory leak in router processing thread#320

Merged
jbaublitz merged 1 commit intomainfrom
neli-308
Jan 28, 2026
Merged

Fix memory leak in router processing thread#320
jbaublitz merged 1 commit intomainfrom
neli-308

Conversation

@jbaublitz
Copy link
Owner

@jbaublitz jbaublitz commented Jan 27, 2026

Closes #308

When dropped, NlRouter would not shut down the thread. This resulted in what is effectively a memory leak with threads hanging around and never being cleaned up.

This change provides fixes for both the synchronous and asynchronous variants, waiting on both the socket for input and the exit notifier to avoid this problem.

I believe I've confirmed both the original problem and resolved it with the PR.

@jbaublitz jbaublitz added this to the neli-0.7.4 milestone Jan 27, 2026
@jbaublitz jbaublitz self-assigned this Jan 27, 2026
@jbaublitz jbaublitz added the bug label Jan 27, 2026
@jbaublitz
Copy link
Owner Author

I believe I've found a couple ways this PR can leak file descriptors in error paths. I'll work on handling file descriptor clean up correctly.

When dropped, NlRouter would not shut down the thread. This resulted in
what is effectively a memory leak with threads hanging around and never
being cleaned up.

This change provides fixes for both the synchronous and asynchronous
variants, waiting on both the socket for input and the exit notifier to
avoid this problem.
@jbaublitz jbaublitz merged commit bc77ce8 into main Jan 28, 2026
45 checks passed
@jbaublitz jbaublitz deleted the neli-308 branch January 28, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Seems there are a potential memory leak in NlRouter::connect

1 participant