Close DB connections once forked processes have completed (LTM 2.4)#470
Merged
Close DB connections once forked processes have completed (LTM 2.4)#470
Conversation
When running the SSOTSyncNetworkData job with 10 devices, the DB connection count would increment by 20, which meant there were two places the code was forking. The first was with the Nornir calling netmiko_send_commands, and the second was with the CommandGetterProcessor in the Nornir setup. Wrapping both of these with the connections.close_call() would close those 20 db connections (10 in one and 10 in the other) after they were finished without breaking the job.
yanshcodilime
approved these changes
Dec 23, 2025
gsnider2195
reviewed
Dec 29, 2025
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
scetron
approved these changes
Jan 8, 2026
Contributor
scetron
left a comment
There was a problem hiding this comment.
This looks good! Thank you.
jeffkala
approved these changes
Jan 8, 2026
huacchob
pushed a commit
that referenced
this pull request
Feb 12, 2026
…470) * fakenos docker compose for testing * Close DB connections when exiting forked processes When running the SSOTSyncNetworkData job with 10 devices, the DB connection count would increment by 20, which meant there were two places the code was forking. The first was with the Nornir calling netmiko_send_commands, and the second was with the CommandGetterProcessor in the Nornir setup. Wrapping both of these with the connections.close_call() would close those 20 db connections (10 in one and 10 in the other) after they were finished without breaking the job. * Add change fragment * Ruff * yamllint * Update Dockerfile-fakenos * Update development/Dockerfile-fakenos Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com> * Add fakenos documentation. --------- Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #366
What's Changed
This is the LTM fix for #366.
When running the SSOTSyncNetworkData job with 10 devices, the DB connection count would increment by 20, which meant there were two places the code was forking. The first was with the Nornir calling netmiko_send_commands, and the second was with the CommandGetterProcessor in the Nornir setup. Wrapping both of these with the connections.close_call() would close those 20 db connections (10 in one and 10 in the other) after they were finished without breaking the job.
This resolves the issue for both Jobs, as they use the same underlying netmiko_send_commands and CommandGetterProcessor.
To Do