Skip to content

Commit

Permalink
proxy: Add various debug logging
Browse files Browse the repository at this point in the history
To aid debugging ostreedev/ostree-rs-ext#657

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Oct 11, 2024
1 parent 3f82e0b commit e715317
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/skopeo/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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":
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit e715317

Please sign in to comment.