From e715317108d5ad40ed365545cd23df9753ca92da Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 11 Oct 2024 13:55:10 +0000 Subject: [PATCH] proxy: Add various debug logging To aid debugging https://github.com/ostreedev/ostree-rs-ext/issues/657 Signed-off-by: Colin Walters --- cmd/skopeo/proxy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/skopeo/proxy.go b/cmd/skopeo/proxy.go index 9396f42273..b13893967f 100644 --- a/cmd/skopeo/proxy.go +++ b/cmd/skopeo/proxy.go @@ -687,6 +687,7 @@ func (h *proxyHandler) FinishPipe(args []any) (replyBuf, error) { // Wait for the goroutine to complete f.wg.Wait() + logrus.Debug("Completed pipe goroutine") // And only now do we close the write half; this forces the client to call this API f.w.Close() // Propagate any errors from the goroutine worker @@ -708,6 +709,7 @@ func (h *proxyHandler) close() { // send writes a reply buffer to the socket func (buf replyBuf) send(conn *net.UnixConn, err error) error { + logrus.Debugf("Sending reply: err=%v value=%v pipeid=%v", err, buf.value, buf.pipeid) replyToSerialize := reply{ Success: err == nil, Value: buf.value, @@ -782,6 +784,8 @@ func (h *proxyHandler) processRequest(readBytes []byte) (rb replyBuf, terminate err = fmt.Errorf("invalid request: %v", err) return } + logrus.Debugf("Executing method %s", req.Method) + // Dispatch on the method switch req.Method { case "Initialize": @@ -845,6 +849,7 @@ func (opts *proxyOptions) run(args []string, stdout io.Writer) error { rb, terminate, err := handler.processRequest(readbuf) if terminate { + logrus.Debug("terminating") return nil }