-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Why are we calling SyncChanges() for TTL updates? #4460
Comments
Hi @flyinprogrammer, the reason for calling TriggerSyncChanges notifies retrySyncFullEventFn, but for that to be handled, the Because of this, calling So you're right, we don't need to call |
thanks for being awesome @freddygv - this was helpful follow up! |
In the AgentCheckPass() endpoint, it would call sometimes, maybe due to network io delay, we have met such problem many times in online environment, any suggestions? @freddygv
|
Hi @249043822. Given current options, I can't think of a better solution than increasing the TTL interval for that check. There is no configuration option to adjust the 10 second timeout for the RPC to sync the check status. Additionally, One way to mitigate this could be to refactor Edit: I created #6616 to track that potential change. |
AgentCheckPass
consul/agent/agent_endpoint.go
Line 431 in 8cbeb29
AgentCheckWarn
consul/agent/agent_endpoint.go
Line 449 in 8cbeb29
AgentCheckFail
consul/agent/agent_endpoint.go
Line 467 in 8cbeb29
All call a blocking call of
s.syncChanges()
:consul/agent/agent_endpoint.go
Lines 342 to 346 in 8cbeb29
consul/agent/local/state.go
Lines 1062 to 1063 in 8cbeb29
What I'm failing to understand is why do we do this?
All three methods call
s.agent.updateTTLCheck(checkID, api.HealthCritical, note)
:consul/agent/agent_endpoint.go
Lines 428 to 430 in 8cbeb29
consul/agent/agent.go
Lines 2498 to 2524 in 8cbeb29
Which calls:
check.SetStatus(status, output)
:consul/agent/agent.go
Line 2510 in 8cbeb29
Which calls
c.Notify.UpdateCheck(c.CheckID, status, output)
:consul/agent/checks/check.go
Line 280 in 8cbeb29
Which goes to this code block:
consul/agent/local/state.go
Lines 469 to 544 in 7fa6bb0
Which either calls
l.TriggerSyncChanges()
or not, depending on whether or not the check update is important:consul/agent/local/state.go
Line 519 in 7fa6bb0
Which is setup when we start the agent:
consul/agent/agent.go
Lines 346 to 351 in 0e02277
Which is used to notify the syncer to do a partial sync
consul/agent/ae/ae.go
Line 275 in 0e02277
Which calls the same
SyncChanges()
method we're going to force every API call to call:consul/agent/ae/ae.go
Line 197 in 0e02277
Seems to me if the syncer is working, we wouldn't ever have to call that extra sync on each api call; however, I'm still learning go, so if someone has cycles to explain to me why my thinking is wrong I would be extra appreciative!
The text was updated successfully, but these errors were encountered: