Repository navigation
Count frames from the broker server as tunnel activity for the idle watchdog #151
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
9e4c2d8
26d2045
f1c6951
2bdbfdf
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 |
|---|---|---|
|
|
@@ -308,14 +308,14 @@ func (r *relayInstanceManager) shouldRestart() (bool, string) { | |
| if r.config.RelayIdleTimeout == 0 || r.reflector == nil { | ||
| return false, "" | ||
| } | ||
| if !r.config.HttpRelayReflectorMode.ReflectsTraffic() { | ||
| // Each reflecting mode gives the watchdog a signal: relayed requests in | ||
| // "traffic", frames on the broker's tunnel in "registration", both in | ||
| // "all". Only "disabled" leaves it blind. | ||
| mode := r.config.HttpRelayReflectorMode | ||
| if !mode.ReflectsTraffic() && !mode.ReflectsRegistration() { | ||
| return false, "" | ||
| } | ||
| lastActivity := r.reflector.LastTrafficTime() | ||
| if startup := r.reflector.LastStartupTime(); startup.After(lastActivity) { | ||
| lastActivity = startup | ||
| } | ||
| if time.Since(lastActivity) >= r.config.RelayIdleTimeout { | ||
| if time.Since(r.reflector.LastActivityTime()) >= r.config.RelayIdleTimeout { | ||
|
Collaborator
Author
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. Agreed — fixed in the latest commit. |
||
| return true, "idle_timeout" | ||
| } | ||
| return false, "" | ||
|
|
||
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.
suuuuuuper nit but it was kind of confusing that there was this default lambda, not sure how i would implement it better though tbh