mirror of
https://github.com/ceph/go-ceph
synced 2024-12-22 14:13:21 +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 (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/ceph/go-ceph/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UserPerm types may be used to get or change the credentials used by the
|
// 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) {
|
func destroyUserPerm(p *UserPerm) {
|
||||||
|
if p.userPerm != nil && p.managed {
|
||||||
|
log.Warnf("unreachable UserPerm object has not been destroyed. Cleaning up.")
|
||||||
|
}
|
||||||
p.Destroy()
|
p.Destroy()
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/ceph/go-ceph/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// The file operation.go exists to support both read op and write op types that
|
// 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) {
|
func opStepFinalizer(s opStep) {
|
||||||
if s != nil {
|
if s != nil {
|
||||||
|
log.Warnf("unreachable opStep object found. Cleaning up.")
|
||||||
s.free()
|
s.free()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import "C"
|
|||||||
import (
|
import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/ceph/go-ceph/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -120,6 +122,7 @@ func NewConnWithClusterAndUser(clusterName string, userName string) (*Conn, erro
|
|||||||
// called.
|
// called.
|
||||||
func freeConn(conn *Conn) {
|
func freeConn(conn *Conn) {
|
||||||
if conn.cluster != nil {
|
if conn.cluster != nil {
|
||||||
|
log.Warnf("unreachable Conn object has not been shut down. Cleaning up.")
|
||||||
C.rados_shutdown(conn.cluster)
|
C.rados_shutdown(conn.cluster)
|
||||||
// prevent calling rados_shutdown() more than once
|
// prevent calling rados_shutdown() more than once
|
||||||
conn.cluster = nil
|
conn.cluster = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user