File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -170,12 +170,18 @@ func (mgr *NetworkManager) allocNetConfig(funcID string) *NetworkConfig {
170170
171171// releaseNetConfig releases the network config of a given function instance with id funcID back to the pool
172172func (mgr * NetworkManager ) releaseNetConfig (funcID string ) {
173+ logger := log .WithFields (log.Fields {"funcID" : funcID })
174+
173175 mgr .Lock ()
174- config := mgr .netConfigs [funcID ]
176+ config , ok := mgr .netConfigs [funcID ]
177+ if ! ok {
178+ mgr .Unlock ()
179+ logger .Warn ("failed to find network config for function" )
180+ return
181+ }
175182 delete (mgr .netConfigs , funcID )
176183 mgr .Unlock ()
177184
178- logger := log .WithFields (log.Fields {"funcID" : funcID })
179185 logger .Debug ("Releasing network config from function instance and adding it to network pool" )
180186
181187 // Add network config back to the pool. We allow the pool to grow over it's configured size here since the
You can’t perform that action at this time.
0 commit comments