8000 chore(vpn): send ping results over tunnel by ethanndickson · Pull Request #18200 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore(vpn): send ping results over tunnel #18200

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

Merged
merged 13 commits into from
Jun 6, 2025
Prev Previous commit
Next Next commit
add pingctx
  • Loading branch information
ethanndickson committed Jun 3, 2025
commit 896548de057a81564ec31f9739916ca674630536
4 changes: 3 additions & 1 deletion vpn/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -621,12 +621,14 @@ func (u *updater) recordLatency() {
}
u.mu.Unlock()

pingCtx, cancelFunc := context.WithTimeout(u.ctx, 5*time.Second)
defer cancelFunc()
var wg sync.WaitGroup
for _, agentID := range agentsIDsToPing {
wg.Add(1)
go func() {
defer wg.Done()
pingDur, didP2p, pingResult, err := u.conn.Ping(u.ctx, agentID)
pingDur, didP2p, pingResult, err := u.conn.Ping(pingCtx, agentID)
if err != nil {
u.logger.Warn(u.ctx, "failed to ping agent", slog.F("agent_id", agentID), slog.Error(err))
return
Expand Down
Loading
0