-
Notifications
You must be signed in to change notification settings - Fork 38
Fix/proxyfor timeout regression #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -766,9 +766,6 @@ func healthy(p Proxy) error { | |||||
| age := now - stat.LastOpen | ||||||
|
|
||||||
| oldEnough := age > ageThreshold.Milliseconds() | ||||||
|
|
||||||
| lastGoodRx := now - stat.LastGoodRx | ||||||
| lastGoodTx := now - stat.LastGoodTx | ||||||
| lastOK := stat.LastOK | ||||||
| lastOKNeverOK := lastOK <= 0 | ||||||
| lastOKBeyondThres := lastOK > 0 && now-lastOK > lastOKThreshold.Milliseconds() | ||||||
|
|
@@ -778,10 +775,8 @@ func healthy(p Proxy) error { | |||||
| pid, core.FmtMillis(age), pxstatus(status), lastOKNeverOK, lastOKBeyondThres) | ||||||
| } else if now-lastOK > tzzTimeout.Milliseconds() { | ||||||
| core.Gx("proxy.health.TZZ."+pid, func() { p.Ping() }) | ||||||
| } else if lastGoodTx > tzzTimeout.Milliseconds() || lastGoodRx > tzzTimeout.Milliseconds() { | ||||||
| core.Gx("proxy.health.TxRx."+pid, func() { p.Ping() }) | ||||||
| } else if status != TOK { | ||||||
| core.Gx("proxy.health.TNOK."+pid, func() { p.Ping() }) | ||||||
| core.Gx("proxy.health.TOK."+pid, func() { p.Ping() }) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [maintainability · low] Suggestion:
Suggested change
|
||||||
| } | ||||||
|
|
||||||
| return nil // ok | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -217,12 +217,6 @@ func (r *icmpResponder) process(h *icmpForwarder, nic tcpip.NICID, pkt *wire.Par | |
| return | ||
| } | ||
|
|
||
| // consult the stack-wide ICMP rate limiter before; see: stackopts.go:SetNetstackOpts | ||
| if h.s != nil && !h.s.AllowICMPMessage() { | ||
| logwv(true)("icmp: responder: rate limited; dropping ping %s => %s", src, dst) | ||
| return | ||
| } | ||
|
|
||
| pinged := h.h.Ping(icmpMsg, src, dst) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [security · medium] |
||
|
|
||
| resp, proto, l4proto, tag, err := r.echoReply(pkt, payload, pinged) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[maintainability · low]
The diagnostic key now contradicts the branch condition. This branch only runs when
status != TOK(status is not OK), but the label was changed fromproxy.health.TNOK.(not-ok) toproxy.health.TOK..TOKis a real status constant meaning "ok" (seepxstatusin proxies.go), so the emitted log key now implies success for a not-ok case, which will mislead anyone filtering these health logs. Suggest keeping a name consistent with the condition.Suggestion: