Skip to content

Commit

Permalink
Merge pull request #60 from BenCastricum/deadlock-fix
Browse files Browse the repository at this point in the history
Revert defer unlock in StayRTR AddVRPs
  • Loading branch information
job authored Jan 26, 2022
2 parents 1bf0956 + 4fef711 commit c4ac625
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ func (s *Server) SetSerial(serial uint32) {

func (s *Server) AddVRPs(vrps []VRP) {
s.vrplock.RLock()
defer s.vrplock.RUnlock()

vrpCurrent := s.vrpCurrent

Expand All @@ -357,6 +356,7 @@ func (s *Server) AddVRPs(vrps []VRP) {
s.log.Debugf("Computed diff: added (%d), removed (%d), unchanged (%d)", len(added), len(removed), len(unchanged))
}
curDiff := append(added, removed...)
s.vrplock.RUnlock()

s.AddVRPsDiff(curDiff)
}
Expand Down

0 comments on commit c4ac625

Please sign in to comment.