Uh oh!
There was an error while loading. Please reload this page.
Lower the time we wait for interfaces to appear - #1471
Conversation
They might never appear.. for example when we have entries in /etc/cloudstack/ips.json that haven't been plugged yet. Waiting this long makes everything horribly slow (every vm, interface, static route, etc, etc, will hit this wait, for every device).
swill
commented
Apr 11, 2016
This seems like a reasonable change to me. I am guessing 2 seconds is long enough, but I don't really understand what other variables could add contention and could cause the 2 seconds to not be long enough. Since this code actually changes logic, I will put it in the queue for CI. |
yadvr
commented
May 2, 2016
tag:needlove |
nlivens
commented
May 3, 2016
@remibergsma, down from 15 to 2 seconds is pretty big in terms of computing time. Is there an internal retry in CS might this script give a timeout? I think this is a good change though, waiting 15 seconds on something to come up is really long. |
@remibergsma you may want to consider cribbing |
nlivens
commented
May 4, 2016
@jburwell, I think that would be a nice solution! |
swill
commented
May 9, 2016
@remibergsma can you review @jburwell's comment and follow up in this thread? Thanks... |
remibergsma
commented
May 12, 2016
@jburwell Thanks, I'll look into that. |
remibergsma
commented
May 13, 2016
@jburwell Had a look at the |
Rerunning tests on this one... |
swill
commented
May 18, 2016
CI RESULTSSummary of the problem(s): Associated Uploads
Uploads will be available until Comment created by |
remibergsma
commented
May 18, 2016
@swill Thanks for running the tests again. The error is |
swill
commented
May 18, 2016
@remibergsma that failure is not one I commonly see, but I definitely do have periodic failures in my environment which complain about "not being able to connect to the outside world", so I think this falls in the same category. There are MANY checks in this suite for connecting out, so if a single one pops, it will usually be a false negative. |
swill
commented
May 26, 2016
Can I get some code review on this one? Thanks... |
nlivens
commented
May 26, 2016
@remibergsma, I understand your concern regarding the wait_until method. Perhaps we could use the wait_until with a 2s interval and a max wait of 4s? That's 1 retry only. That means that the max wait time has been drastically reduced from 15s to 4s, but you have that extra window of 2s for potential hiccups to happen |
karuturi
commented
May 26, 2016
LGTM 👍(code review only) |
swill
commented
May 26, 2016
CI RESULTSAssociated Uploads
Uploads will be available until Comment created by |
remibergsma
commented
May 26, 2016
@nlivens We shouldn't wait more than 2s, because that means the interface is not there and will not come yet. Currently it's horribly slow because every command send to the router will try to see if the interface is there and wait. All those waits together really add up. Especially when restarting. I really think we should keep it like this since it already tries 2 times now. |
nlivens
commented
May 26, 2016
@remibergsma, sounds fair. LGTM |
swill
commented
May 26, 2016
Thanks guys. This one is ready... |
Lower the time we wait for interfaces to appearWaiting for interfaces is tricky. They might never appear.. for example when we have entries in `/etc/cloudstack/ips.json` that haven't been plugged yet. Waiting this long makes everything horribly slow (every vm, interface, static route, etc, etc, will hit this wait, for every device). We've seen CloudStack send an `ip_assoc.json` command for `eth1` public nic only and then the router goes crazy waiting for all other interfaces that were there before reboot and aren't there. If only the router would return to the mgt server a success of `eth1`, it would get the command for `eth2` etc etc. Obviously, a destroy works much faster because no state services, so no knowledge of previous devices so no waits :-) After a stop/start the router has state in `/etc/cloudstack/ips.json` and every commands waits. Eventually hitting the hardcoded 120 sec timeout. * pr/1471: lower the time we wait for interfaces to appear Signed-off-by: Will Stevens <williamstevens@gmail.com>
Waiting for interfaces is tricky. They might never appear.. for example when we have entries in
/etc/cloudstack/ips.jsonthat haven't been plugged yet. Waiting this long makes everything horribly slow (every vm, interface, static route, etc, etc, will hit this wait, for every device). We've seen CloudStack send anip_assoc.jsoncommand foreth1public nic only and then the router goes crazy waiting for all other interfaces that were there before reboot and aren't there. If only the router would return to the mgt server a success ofeth1, it would get the command foreth2etc etc. Obviously, a destroy works much faster because no state services, so no knowledge of previous devices so no waits :-)After a stop/start the router has state in
/etc/cloudstack/ips.jsonand every commands waits. Eventually hitting the hardcoded 120 sec timeout.