-
Notifications
You must be signed in to change notification settings - Fork 37
fix(ipn/proxies): restore getproxytimeout for proxyFor lock-read guard #248
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 & Code Quality | 🟡 Minor | ⚡ Quick win Keep the non-TOK health key distinct. This branch runs only when Proposed key correction- core.Gx("proxy.health.TOK."+pid, func() { p.Ping() })
+ core.Gx("proxy.health.TNOK."+pid, func() { p.Ping() })📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 8 'func trackwork|trackwork\(' intra/core
rg -n -C 10 'func \([^)]*\) Ping\(\) bool|func Ping\(\) bool' intra/ipn intra/core
rg -n -C 6 '\bproxyFor\(|\bhealthy\(' intra/ipnRepository: celzero/firestack Length of output: 23052 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- healthy and proxyFor ---'
sed -n '746,790p' intra/ipn/proxy.go
sed -n '910,972p' intra/ipn/proxies.go
printf '%s\n' '--- all Proxy implementations and Ping call paths ---'
rg -n -C 8 'Ping\(\) bool|\.Ping\(\)' intra/ipn --glob '*.go'
rg -n -C 5 'type Proxy interface|interface .*Proxy' intra/ipn intra/coreRepository: celzero/firestack Length of output: 12524 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- changed line and nearby status logic ---'
sed -n '751,784p' intra/ipn/proxy.go
printf '%s\n' '--- Ping implementations, including embedded/delegating types ---'
rg -n -C 12 'func[[:space:]]*(\([^)]*\)[[:space:]]*)?Ping[[:space:]]*\(' intra --glob '*.go'
rg -n -C 6 'type[[:space:]]+Proxy[[:space:]]+interface|Ping[[:space:]]*\(\)[[:space:]]*bool' intra --glob '*.go'Repository: celzero/firestack Length of output: 16395 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- exact core.Gx contract and worker-key usage ---'
sed -n '74,90p' intra/core/async.go
rg -n -C 5 'proxy\.health\.(TOK|TNOK)|proxy\.health' intra --glob '*.go'
printf '%s\n' '--- wgproxy Ping complete body ---'
sed -n '275,320p' intra/ipn/wgproxy.goRepository: celzero/firestack Length of output: 3133 🏁 Script executed: #!/bin/bash
set -euo pipefail
sed -n '746,790p' intra/ipn/proxy.go
sed -n '910,972p' intra/ipn/proxies.go
sed -n '275,315p' intra/ipn/wgproxy.go
rg -n -C 10 'func[[:space:]]*(\([^)]*\)[[:space:]]*)?Ping[[:space:]]*\(' intra --glob '*.go'Repository: celzero/firestack Length of output: 13511 Restore health-ping coalescing
🤖 Prompt for AI Agents |
||||||
| } | ||||||
|
|
||||||
| return nil // ok | ||||||
|
|
||||||
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.
[other · medium]
The event label was renamed from
TNOKtoTOK, but this branch still fires only whenstatus != TOK(i.e. exactly when the proxy is NOT ok). The new label is therefore inverted relative to the guard and the surrounding semantics:proxy.health.TOK.<pid>will be recorded precisely for pings of unhealthy proxies, which will mislead anyone correlating these events/metrics with proxy health (and contradictspxstatus, whereTOKmeans "ok"). Either keep the originalTNOKlabel, or — if the goal was to take over the removed TxRx branch that pinged healthy-but-idle proxies — the condition should bestatus == TOKrather than a label-only change.Suggestion: