Close DB connections once forked processes have completed#471
Merged
Close DB connections once forked processes have completed#471
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
yanshcodilime
approved these changes
Dec 23, 2025
gsnider2195
approved these changes
Dec 29, 2025
Contributor
gsnider2195
left a comment
There was a problem hiding this comment.
This is working great for me. Thanks @smk4664!
It would be nice to have a small blurb in the docs to explain how to use the fakenos compose file
gsnider2195
reviewed
Dec 29, 2025
gsnider2195
reviewed
Dec 29, 2025
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
jeffkala
approved these changes
Jan 8, 2026
latuannetnam
pushed a commit
to latuannetnam/nautobot-app-device-onboarding
that referenced
this pull request
Jan 9, 2026
* Fix issue with DB connections not closing * Update development/Dockerfile-fakenos Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com> * 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
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