Skip to content

Close DB connections once forked processes have completed (LTM 2.4)#470

Merged
smk4664 merged 8 commits intoltm-2.4from
NAPPS-770/nornir-db-connections
Jan 8, 2026
Merged

Close DB connections once forked processes have completed (LTM 2.4)#470
smk4664 merged 8 commits intoltm-2.4from
NAPPS-770/nornir-db-connections

Conversation

@smk4664
Copy link
Copy Markdown
Contributor

@smk4664 smk4664 commented Dec 23, 2025

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

  • Explanation of Change(s)
  • Added change log fragment(s) (for more information see the documentation)
  • Attached Screenshots, Payload Example
  • Unit, Integration Tests
  • Documentation Updates (when adding/changing features)
  • Outline Remaining Work, Constraints from Design

gsnider2195 and others added 4 commits December 18, 2025 15:51
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.
@smk4664 smk4664 changed the title Close DB connections once forked processes have completed Close DB connections once forked processes have completed (LTM 2.4) Dec 23, 2025
Comment thread development/Dockerfile-fakenos Outdated
smk4664 and others added 2 commits December 29, 2025 20:16
Co-authored-by: Gary Snider <75227981+gsnider2195@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@scetron scetron left a comment

Choose a reason for hiding this comment

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

This looks good! Thank you.

@smk4664 smk4664 merged commit ad745e4 into ltm-2.4 Jan 8, 2026
14 checks passed
@smk4664 smk4664 deleted the NAPPS-770/nornir-db-connections branch January 8, 2026 16:15
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>
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.

5 participants