From 8ccb0185b3547e3bdcdaa438a452e51e2d2c8196 Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:01:18 +0000 Subject: [PATCH] Include mutexes in spans --- sync3/conn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sync3/conn.go b/sync3/conn.go index 5b8e95c..7fcb32e 100644 --- a/sync3/conn.go +++ b/sync3/conn.go @@ -135,6 +135,7 @@ func (c *Conn) isOutstanding(pos int64) bool { // client. It will NOT be reported to Sentry---this should happen as close as possible // to the creation of the error (or else Sentry cannot provide a meaningful traceback.) func (c *Conn) OnIncomingRequest(ctx context.Context, req *Request, start time.Time) (resp *Response, herr *internal.HandlerError) { + ctx, span := internal.StartSpan(ctx, "OnIncomingRequest.AcquireMutex") c.cancelOutstandingRequestMu.Lock() if c.cancelOutstandingRequest != nil { c.cancelOutstandingRequest() @@ -149,6 +150,7 @@ func (c *Conn) OnIncomingRequest(ctx context.Context, req *Request, start time.T // it's intentional for the lock to be held whilst inside HandleIncomingRequest // as it guarantees linearisation of data within a single connection defer c.mu.Unlock() + span.End() isFirstRequest := req.pos == 0 isRetransmit := !isFirstRequest && c.lastClientRequest.pos == req.pos