Skip to content

Commit

Permalink
Merge pull request #325 from stgraber/main
Browse files Browse the repository at this point in the history
incusd/network/ovsdb: Properly close the connections
  • Loading branch information
hallyn authored Dec 22, 2023
2 parents 4595146 + 697cafa commit 032e040
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/server/network/ovn/ovn_nb.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func NewNB(s *state.State) (*NB, error) {
// Set finalizer to stop the monitor.
runtime.SetFinalizer(client, func(o *NB) {
_ = ovn.MonitorCancel(context.Background(), o.cookie)
ovn.Close()
})

return client, nil
Expand Down
1 change: 1 addition & 0 deletions internal/server/network/ovn/ovn_sb.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func NewSB(s *state.State) (*SB, error) {
// Set finalizer to stop the monitor.
runtime.SetFinalizer(client, func(o *SB) {
_ = ovn.MonitorCancel(context.Background(), o.cookie)
ovn.Close()
})

return client, nil
Expand Down
1 change: 1 addition & 0 deletions internal/server/network/ovs/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func NewVSwitch() (*VSwitch, error) {
// Set finalizer to stop the monitor.
runtime.SetFinalizer(client, func(o *VSwitch) {
_ = ovs.MonitorCancel(context.Background(), o.cookie)
ovs.Close()
})

// Get the root UUID.
Expand Down

0 comments on commit 032e040

Please sign in to comment.