mirror of
https://github.com/ceph/go-ceph
synced 2024-12-22 06:10:09 +00:00
go-ceph: add warn logs to finalizers.
Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
parent
f5d1adf26f
commit
fdd9853f0f
@ -10,6 +10,8 @@ import "C"
|
||||
import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ceph/go-ceph/internal/log"
|
||||
)
|
||||
|
||||
// UserPerm types may be used to get or change the credentials used by the
|
||||
@ -68,5 +70,8 @@ func (p *UserPerm) Destroy() {
|
||||
}
|
||||
|
||||
func destroyUserPerm(p *UserPerm) {
|
||||
if p.userPerm != nil && p.managed {
|
||||
log.Warnf("unreachable UserPerm object has not been destroyed. Cleaning up.")
|
||||
}
|
||||
p.Destroy()
|
||||
}
|
||||
|
@ -7,6 +7,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ceph/go-ceph/internal/log"
|
||||
)
|
||||
|
||||
// The file operation.go exists to support both read op and write op types that
|
||||
@ -116,6 +118,7 @@ func (o *operation) update(kind opKind, ret C.int) error {
|
||||
|
||||
func opStepFinalizer(s opStep) {
|
||||
if s != nil {
|
||||
log.Warnf("unreachable opStep object found. Cleaning up.")
|
||||
s.free()
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ import "C"
|
||||
import (
|
||||
"runtime"
|
||||
"unsafe"
|
||||
|
||||
"github.com/ceph/go-ceph/internal/log"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -120,6 +122,7 @@ func NewConnWithClusterAndUser(clusterName string, userName string) (*Conn, erro
|
||||
// called.
|
||||
func freeConn(conn *Conn) {
|
||||
if conn.cluster != nil {
|
||||
log.Warnf("unreachable Conn object has not been shut down. Cleaning up.")
|
||||
C.rados_shutdown(conn.cluster)
|
||||
// prevent calling rados_shutdown() more than once
|
||||
conn.cluster = nil
|
||||
|
Loading…
Reference in New Issue
Block a user