Skip to content

Commit 0231168

Browse files
committed
debug: i need stack tracing, the spaceId is getting lost somewhere
1 parent 1db17a1 commit 0231168

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/spaces/utils.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"fmt"
2525
"os"
2626
"path/filepath"
27+
"runtime"
2728
"strings"
2829

2930
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
@@ -89,6 +90,10 @@ func EncodeResourceID(r *provider.ResourceId) string {
8990
encoded = fmt.Sprintf("%s!%s", r.StorageId, r.OpaqueId)
9091
fmt.Fprintf(os.Stderr, "[DEBUG] EncodeResourceID: storage=%q, space=(empty), opaque=%q -> %q\n",
9192
r.StorageId, r.OpaqueId, encoded)
93+
fmt.Fprintf(os.Stderr, "[DEBUG] EncodeResourceID STACK (space empty):\n")
94+
buf := make([]byte, 4096)
95+
n := runtime.Stack(buf, false)
96+
fmt.Fprintf(os.Stderr, "%s\n", buf[:n])
9297
} else if r.OpaqueId == "" {
9398
encoded = fmt.Sprintf("%s$%s", r.StorageId, r.SpaceId)
9499
fmt.Fprintf(os.Stderr, "[DEBUG] EncodeResourceID: storage=%q, space=%q, opaque=(empty) -> %q\n",

0 commit comments

Comments
 (0)