Skip to content

The total time in trace info may become MAX_INT64 in some invalid requests #1016

@git-hulk

Description

@git-hulk

Currently, the request total is calculated by EndTime - DNS Start Time | Get Conn Time:

resty/request.go

Lines 1256 to 1260 in 036c589

if ct.gotConnInfo.Reused {
ti.TotalTime = ct.endTime.Sub(ct.getConn)
} else {
ti.TotalTime = ct.endTime.Sub(ct.dnsStart)
}

And in Go's transport, it won't call the GetConn if the request is invalid(for example: an invalid URL format), so both of DNS Start Time | Get Conn Time are zero. So it will get MAX_INT64 if we use a valid time to sub the zero time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions