MCPcopy
hub / github.com/CodisLabs/codis / Release

Method Release

pkg/proxy/backend.go:418–436  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

416}
417
418func (s *sharedBackendConn) Release() {
419 if s == nil {
420 return
421 }
422 if s.refcnt <= 0 {
423 log.Panicf("shared backend conn has been closed, close too many times")
424 } else {
425 s.refcnt--
426 }
427 if s.refcnt != 0 {
428 return
429 }
430 for _, parallel := range s.conns {
431 for _, bc := range parallel {
432 bc.Close()
433 }
434 }
435 delete(s.owner.pool, s.addr)
436}
437
438func (s *sharedBackendConn) Retain() *sharedBackendConn {
439 if s == nil {

Callers 1

fillSlotMethod · 0.45

Calls 2

PanicfMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected