cmd/vet: flag use of .Timeout() after Set*Deadline() #38508
Labels
Analysis
Issues related to static analysis (vet, x/tools/go/analysis)
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
In #31449 it was decided to make deadline expiration return a newly-defined error, as checking
net.OpError.Timeout()
also detects keepalive failures. Keepalives were enabled by default for TCP clients in 1.12 and servers in 1.13, breaking some code setting deadlines longer than the keepalive period (which varies with platform).This means that .Timeout() use after Set*Deadline() should be changed to look for the new error, since that is not a reliable way to check for deadline-expired.
I suggest go vet flag use of .Timeout() after Set*Deadline(). That will generate reports for existing code, but perhaps that's better than leaving code broken due to the keepalive problem.
Triage: milestone should be 1.15
@gopherbot add NeedsDecision
The text was updated successfully, but these errors were encountered: