Skip to content

Commit

Permalink
Improve timeouts of compatibility check
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Aug 4, 2023
1 parent ec36dc1 commit a76e659
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions compat/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var (
module *modules.Module

selfcheckTask *modules.Task
selfcheckTaskRetryAfter = 5 * time.Second
selfcheckTaskRetryAfter = 15 * time.Second

// selfCheckIsFailing holds whether or not the self-check is currently
// failing. This helps other failure systems to not make noise when there is
Expand All @@ -34,7 +34,7 @@ var (

// selfcheckFailThreshold holds the threshold of how many times the selfcheck
// must fail before it is reported.
const selfcheckFailThreshold = 5
const selfcheckFailThreshold = 10

func init() {
module = modules.Register("compat", prep, start, stop, "base", "network", "interception", "netenv", "notifications")
Expand All @@ -60,7 +60,7 @@ func start() error {
Schedule(time.Now().Add(selfcheckTaskRetryAfter))

module.NewTask("clean notify thresholds", cleanNotifyThreshold).
Repeat(10 * time.Minute)
Repeat(1 * time.Hour)

return module.RegisterEventHook(
netenv.ModuleName,
Expand Down
2 changes: 1 addition & 1 deletion compat/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (issue *appIssue) notify(proc *process.Process) {
}

const (
notifyThresholdMinIncidents = 11
notifyThresholdMinIncidents = 10
notifyThresholdResetAfter = 2 * time.Minute
)

Expand Down
4 changes: 2 additions & 2 deletions compat/selfcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ var (
systemIntegrationCheckDialNet = fmt.Sprintf("ip4:%d", uint8(SystemIntegrationCheckProtocol))
systemIntegrationCheckDialIP = SystemIntegrationCheckDstIP.String()
systemIntegrationCheckPackets = make(chan packet.Packet, 1)
systemIntegrationCheckWaitDuration = 40 * time.Second
systemIntegrationCheckWaitDuration = 45 * time.Second

// DNSCheckInternalDomainScope is the domain scope to use for dns checks.
DNSCheckInternalDomainScope = ".self-check." + resolver.InternalSpecialUseDomain
dnsCheckReceivedDomain = make(chan string, 1)
dnsCheckWaitDuration = 40 * time.Second
dnsCheckWaitDuration = 45 * time.Second
dnsCheckAnswerLock sync.Mutex
dnsCheckAnswer net.IP
)
Expand Down

0 comments on commit a76e659

Please sign in to comment.