'juju status' asks for presence (IsAlive) for each object one-by-one
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned | ||
2.2 |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
If you turn on "logging-
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("m#2") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("m#0") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("m#1") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/11") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/5") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/6") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/8") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/3") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/4") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/7") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/9") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/10") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/0") -> true
machine-0: 15:50:15 TRACE juju.state.presence pingbatcher has 0 pings to record
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/1") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("u#ul/2") -> true
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] got request: presence.
machine-0: 15:50:15 TRACE juju.state.presence [8e869b] Alive("
We're not doing a "sync" for each of these, so its just returning whatever the current cached lifetime is in memory for each object. But it is a fair bit of overhead (creating a channel to return the response on, putting the request into the channel, handling it, returning the values, etc.). It would be better if we asked for the presence information in a large batch with a single return.
https:/ /github. com/jameinel/ juju/tree/ 2.2-presence- multi-1703594
The above branch is a start at changing the presence code to support a batch call of the presence for all agents in one request.
However, apiserver/ client/ status. go is still written very much as: ation(machine)
for _, machine := range machines {
infoForMachine = getStatusInform
}
for _, app := range applications {
infoForApp = processApp(app)
}
So none of that code builds up a list of things to ask about, and then asks about them all at once. So it isn't worth updating Presence until we have a good caller that can actually call it in a meaningful way. Not worth it yet.