mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-22 22:58:25 +00:00
lib/model: Fix locking when resending cluster-configs (#7107)
This commit is contained in:
parent
326111d10f
commit
54643e86b5
@ -2375,13 +2375,18 @@ func (m *model) CommitConfiguration(from, to config.Configuration) bool {
|
||||
go conn.Close(errDeviceRemoved)
|
||||
}
|
||||
}
|
||||
ccConns := make([]protocol.Connection, 0, len(clusterConfigDevices))
|
||||
for id := range clusterConfigDevices {
|
||||
if conn, ok := m.conn[id]; ok {
|
||||
cm := m.generateClusterConfig(conn.ID())
|
||||
go conn.ClusterConfig(cm)
|
||||
ccConns = append(ccConns, conn)
|
||||
}
|
||||
}
|
||||
m.pmut.RUnlock()
|
||||
// Generating cluster-configs acquires fmut -> must happen outside of pmut.
|
||||
for _, conn := range ccConns {
|
||||
cm := m.generateClusterConfig(conn.ID())
|
||||
go conn.ClusterConfig(cm)
|
||||
}
|
||||
|
||||
m.globalRequestLimiter.setCapacity(1024 * to.Options.MaxConcurrentIncomingRequestKiB())
|
||||
m.folderIOLimiter.setCapacity(to.Options.MaxFolderConcurrency())
|
||||
|
Loading…
x
Reference in New Issue
Block a user