Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

bug in function handler #5

Closed
Closed
@beardeddog

Description

encountered a repeated failure traced down into conn.go, function handler, in the receive loop where the the log message Response for unknown request with xid # is sent.

existing code is

} else {
            c.requestsLock.Lock()
            req, ok := c.requests[res.Xid]
            if ok {
                delete(c.requests, res.Xid)
            }
            c.requestsLock.Unlock()

            if !ok {
>>              log.Printf("Response for unknown request with xid %d", res.Xid)
            } else {
                _, err := decodePacket(buf[:blen], req.recvStruct)
                req.recvChan <- err
            }
        }

changed the

log.Printf("Response for unknown request with xid %d", res.Xid)

to be

req.recvChan <- errors.New("UNKWNREQ: Response for unknown request with xid " + string(res.Xid))

basically the channel needs a reply, otherwise we just hang

the error message I'm sending back is something you probably want to align with your error handling, but I did need to see this specific error so I could attempt recovery in my client code, in my case I just retry if I get this error

Bill

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions