Commit ee3694f4 authored by David Johnson's avatar David Johnson

Do not run ddjikstra while holding the global lock in docker clientside.

(All we need to do while holding the global lock is allocated IFBs; the
generation of routing scripts and traffic shaping scripts is both
unlikely to fail and potentially slow due to running djikstra.  So, also
let the vnode early release prior to those things, immediately after IFB
allocation.)
parent faf2368f
......@@ -2602,27 +2602,19 @@ sub rootPreConfigNetwork($$$$)
# to look for IFBs that are already allocated to the
# container. See the allocate routines, which make use of the tag.
#
my $ifbs;
if (@node_lds) {
my $ifbs = AllocateIFBs($vmid, \@node_lds, $private);
$ifbs = AllocateIFBs($vmid, \@node_lds, $private);
goto bad
if (!(defined($ifbs)));
foreach my $ldc (@node_lds) {
my $tag = "$vnode_id:" . $ldc->{'LINKNAME'};
my $ifb = pop(@$ifbs);
$private->{'ifbs'}->{$ifb} = $tag;
# Stash for later.
$ldc->{'IFB'} = $ifb;
}
CreateShapingScripts($vnode_id,$private,\@node_ifs,\@node_lds);
}
# Setup our routing stuff.
CreateRoutingScripts($vnode_id,$private);
#
# We cannot hold the global lock while we run CreateRoutingScripts.
# For a large topo, this may call djikstra, and that can be quite
# CPU-consuming. Also, may as well avoid it on
# CreateShapingScripts.
#
TBDebugTimeStamp(" releasing global lock")
if ($lockdebug);
TBScriptUnlock();
......@@ -2638,6 +2630,25 @@ sub rootPreConfigNetwork($$$$)
mysystem2("touch $VMS/$vnode_id/running");
}
#
# Return to handling the allocated IFBs for shaping.
#
if (@node_lds) {
foreach my $ldc (@node_lds) {
my $tag = "$vnode_id:" . $ldc->{'LINKNAME'};
my $ifb = pop(@$ifbs);
$private->{'ifbs'}->{$ifb} = $tag;
# Stash for later.
$ldc->{'IFB'} = $ifb;
}
CreateShapingScripts($vnode_id,$private,\@node_ifs,\@node_lds);
}
# Setup our routing stuff.
CreateRoutingScripts($vnode_id,$private);
return 0;
bad:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment