types/logger, logpolicy: disable rate limiting, don't upload on Plan 9

To ease local debugging and have fewer moving pieces while bringing up
Plan 9 support.

Updates #5794

Change-Id: I2dc98e73bbb0d4d4730dc47203efc0550a0ac0a0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2025-04-01 04:01:00 -07:00 committed by Brad Fitzpatrick
parent 3da1728207
commit da8e8eb86f
2 changed files with 6 additions and 1 deletions

View File

@ -627,7 +627,7 @@ func (opts Options) New() *Policy {
conf.IncludeProcSequence = true
}
if envknob.NoLogsNoSupport() || testenv.InTest() {
if envknob.NoLogsNoSupport() || testenv.InTest() || runtime.GOOS == "plan9" {
opts.Logf("You have disabled logging. Tailscale will not be able to provide support.")
conf.HTTPC = &http.Client{Transport: noopPretendSuccessTransport{}}
} else {

View File

@ -14,6 +14,7 @@ import (
"fmt"
"io"
"log"
"runtime"
"strings"
"sync"
"time"
@ -162,6 +163,10 @@ func RateLimitedFnWithClock(logf Logf, f time.Duration, burst int, maxCache int,
if envknob.String("TS_DEBUG_LOG_RATE") == "all" {
return logf
}
if runtime.GOOS == "plan9" {
// To ease bring-up.
return logf
}
var (
mu sync.Mutex
msgLim = make(map[string]*limitData) // keyed by logf format